<?xml version="1.0" encoding="utf-8" ?>
<local:StartupPageControlBase
    x:Class="RodelAgent.UI.Controls.Startup.StartupWelcomeSection"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:animations="using:CommunityToolkit.WinUI.Animations"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="using:RodelAgent.UI.Extensions"
    xmlns:ic="using:FluentIcons.WinUI"
    xmlns:local="using:RodelAgent.UI.Controls.Startup"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Image
            Width="180"
            VerticalAlignment="Center"
            Source="ms-appx:///Assets/big-logo.png">
            <animations:Implicit.ShowAnimations>
                <animations:OpacityAnimation
                    From="0"
                    To="1.0"
                    Duration="0:0:0.5" />
            </animations:Implicit.ShowAnimations>
        </Image>

        <StackPanel
            Grid.Column="1"
            Margin="0,0,32,0"
            VerticalAlignment="Center"
            Spacing="20">
            <TextBlock Style="{StaticResource TitleTextBlockStyle}" Text="{ext:Locale Name=WelcomeTitle}" />
            <TextBlock
                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                LineHeight="24"
                Text="{ext:Locale Name=WelcomeDescription}"
                TextWrapping="Wrap" />

            <StackPanel Margin="0,8,0,0" Visibility="{x:Bind ViewModel.SelectedFolder, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}">
                <TextBlock
                    HorizontalAlignment="Left"
                    Foreground="{ThemeResource TextFillColorDisabledBrush}"
                    Style="{StaticResource CaptionTextBlockStyle}"
                    Text="{ext:Locale Name=WorkDirectory}" />
                <Grid ColumnSpacing="12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <TextBlock
                        x:Name="FolderBlock"
                        VerticalAlignment="Center"
                        MaxLines="1"
                        Text="{x:Bind ViewModel.SelectedFolder, Mode=OneWay}"
                        TextTrimming="CharacterEllipsis">
                        <ToolTipService.ToolTip>
                            <ToolTip Content="{x:Bind ViewModel.SelectedFolder, Mode=OneWay}" IsEnabled="{x:Bind FolderBlock.IsTextTrimmed, Mode=OneWay}" />
                        </ToolTipService.ToolTip>
                    </TextBlock>
                    <Button
                        Grid.Column="1"
                        Padding="0"
                        VerticalAlignment="Center"
                        AutomationProperties.Name="{ext:Locale Name=ChangeDirectory}"
                        Command="{x:Bind ViewModel.SelectFolderCommand}"
                        Style="{StaticResource IconButtonStyle}"
                        ToolTipService.ToolTip="{ext:Locale Name=ChangeDirectory}">
                        <ic:SymbolIcon
                            FontSize="14"
                            IconVariant="Filled"
                            Symbol="Edit" />
                    </Button>
                </Grid>

            </StackPanel>

            <animations:Implicit.ShowAnimations>
                <animations:TranslationAnimation
                    From="0, 20, 0"
                    To="0,0,0"
                    Duration="0:0:0.5" />
                <animations:OpacityAnimation
                    From="0"
                    To="1.0"
                    Duration="0:0:0.5" />
            </animations:Implicit.ShowAnimations>
        </StackPanel>
    </Grid>
</local:StartupPageControlBase>
