<?xml version="1.0" encoding="utf-8" ?>
<l:AppContentPage
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:l="clr-namespace:Blahblah.FlowerApp"
    xmlns:data="clr-namespace:Blahblah.FlowerApp.Data"
    xmlns:ctl="clr-namespace:Blahblah.FlowerApp.Controls"
    x:Class="Blahblah.FlowerApp.UserPage"
    x:Name="userPage"
    x:DataType="l:UserPage"
    Title="{l:Lang userPage, Default=Profile}">

    <ContentPage.Resources>
        <l:UserNameConverter x:Key="nameConverter"/>
    </ContentPage.Resources>

    <TableView Grid.Row="1" Intent="Settings" HasUnevenRows="True" BindingContext="{x:Reference userPage}">
        <TableSection>
            <ctl:OptionTextCell Title="{Binding Name, Source={x:Static l:AppResources.User}, Converter={StaticResource nameConverter}}"/>
        </TableSection>
        <TableSection>
            <ctl:OptionSelectCell Title="设置" Icon="{FontImageSource FontFamily=FontAwesomeLight, Size=18, Color={StaticResource Blue200Accent}, Glyph={x:Static l:Res.Gear}}"/>
            <ctl:OptionSelectCell Title="日志" Icon="{FontImageSource FontFamily=FontAwesomeLight, Size=18, Color={StaticResource Primary}, Glyph={x:Static l:Res.List}}"
                                  Detail="{Binding LogCount}" Tapped="Log_Tapped"/>
        </TableSection>
        <TableSection>
            <ctl:OptionTextCell Title="关于" Detail="{x:Static data:Constants.AppVersion}"
                                Icon="{FontImageSource FontFamily=FontAwesomeLight, Size=18, Color={StaticResource Yellow200Accent}, Glyph={x:Static l:Res.Flag}}"/>
        </TableSection>
    </TableView>

</l:AppContentPage>