<!--  Copyright (c) Microsoft Corporation and Contributors.  -->
<!--  Licensed under the MIT License.  -->

<UserControl
    x:Class="Peek.FilePreviewer.Controls.InformationalPreviewControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid ColumnSpacing="24">
        <Grid.ColumnDefinitions>
            <ColumnDefinition x:Name="Icon" Width="Auto" />
            <ColumnDefinition x:Name="FileInfo" Width="*" />
        </Grid.ColumnDefinitions>

        <Image
            x:Name="FileIcon"
            Grid.Column="0"
            Width="180"
            Height="180"
            Source="{x:Bind Source.IconPreview, Mode=OneWay}" />

        <StackPanel
            Grid.Column="1"
            VerticalAlignment="Center"
            Spacing="4">

            <TextBlock
                MaxLines="3"
                Style="{StaticResource TitleTextBlockStyle}"
                Text="{x:Bind Source.FileName, Mode=OneWay}"
                TextTrimming="CharacterEllipsis"
                TextWrapping="Wrap">
                <ToolTipService.ToolTip>
                    <ToolTip Content="{x:Bind Source.FileName, Mode=OneWay}" />
                </ToolTipService.ToolTip>
            </TextBlock>
            <TextBlock Text="{x:Bind FormatFileType(Source.FileType), Mode=OneWay}">
                <ToolTipService.ToolTip>
                    <ToolTip Content="{x:Bind FormatFileType(Source.FileType), Mode=OneWay}" />
                </ToolTipService.ToolTip>
            </TextBlock>
            <TextBlock Text="{x:Bind FormatFileSize(Source.FileSize), Mode=OneWay}">
                <ToolTipService.ToolTip>
                    <ToolTip Content="{x:Bind FormatFileSize(Source.FileSize), Mode=OneWay}" />
                </ToolTipService.ToolTip>
            </TextBlock>
            <TextBlock Text="{x:Bind FormatFileDateModified(Source.DateModified), Mode=OneWay}">
                <ToolTipService.ToolTip>
                    <ToolTip Content="{x:Bind FormatFileDateModified(Source.DateModified), Mode=OneWay}" />
                </ToolTipService.ToolTip>
            </TextBlock>
        </StackPanel>
    </Grid>
</UserControl>
