<abstract:EmailTemplatesPageAbstract
    x:Class="Wino.Views.Settings.EmailTemplatesPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:abstract="using:Wino.Views.Abstract"
    xmlns:controls="using:CommunityToolkit.WinUI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:domain="using:Wino.Core.Domain"
    xmlns:entities="using:Wino.Core.Domain.Entities.Mail"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <ScrollViewer>
        <StackPanel Spacing="{StaticResource SettingsCardSpacing}">
            <controls:SettingsCard
                Click="NewTemplateClicked"
                Description="{x:Bind domain:Translator.SettingsEmailTemplates_NewTemplateDescription}"
                Header="{x:Bind domain:Translator.SettingsEmailTemplates_NewTemplateTitle}"
                IsClickEnabled="True">
                <controls:SettingsCard.HeaderIcon>
                    <FontIcon Glyph="&#xE710;" />
                </controls:SettingsCard.HeaderIcon>
            </controls:SettingsCard>

            <ItemsControl ItemsSource="{x:Bind ViewModel.EmailTemplates, Mode=OneWay}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate x:DataType="entities:EmailTemplate">
                        <controls:SettingsCard
                            Margin="0,0,0,4"
                            Click="TemplateClicked"
                            Description="{x:Bind Description}"
                            Header="{x:Bind Name}"
                            IsClickEnabled="True"
                            Tag="{x:Bind}">
                            <controls:SettingsCard.HeaderIcon>
                                <FontIcon Glyph="&#xE70F;" />
                            </controls:SettingsCard.HeaderIcon>
                        </controls:SettingsCard>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </StackPanel>
    </ScrollViewer>
</abstract:EmailTemplatesPageAbstract>
