<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
             x:Class="Dollet.Views.TransactionGroupItemView">

    <Border
        Padding="5, 5, 10, 5"
        Margin="10, 5, 10, 0">

        <Border.StrokeShape>
            <RoundRectangle CornerRadius="15"/>
        </Border.StrokeShape>

        <Grid ColumnDefinitions="auto, *, auto, auto" ColumnSpacing="10">
            <toolkit:AvatarView
                FontSize="28"
                WidthRequest="40"
                HeightRequest="40"
                Text="{Binding Icon}"
                FontFamily="MaterialIconsRegular"
                BackgroundColor="{Binding Color}"/>

            <Label 
                Grid.Column="1"
                Text="{Binding Category}" 
                FontSize="Large"
                VerticalOptions="Center"/>

            <Label 
                Grid.Column="2"
                Text="{Binding Percent, StringFormat='{0:F2}%'}"
                FontSize="16"
                VerticalOptions="Center"/>

            <Label 
                Grid.Column="3"
                Text="{Binding Amount, StringFormat='{0:F2} zł'}"
                FontSize="16"
                VerticalOptions="Center"/>
        </Grid>
    </Border>
</ContentView>
