<?xml version="1.0" encoding="utf-8" ?>
<local:WebDavPageControlBase
    x:Class="BiliCopilot.UI.Controls.WebDav.WebDavPageHeader"
    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:ext="using:BiliCopilot.UI.Extensions"
    xmlns:ic="using:FluentIcons.WinUI"
    xmlns:local="using:BiliCopilot.UI.Controls.WebDav"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:models="using:BiliCopilot.UI.Models"
    mc:Ignorable="d">

    <Grid Padding="16,0" ColumnSpacing="12">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <BreadcrumbBar
            HorizontalAlignment="Stretch"
            VerticalAlignment="Center"
            ItemClicked="OnPathSegmentClick"
            ItemsSource="{x:Bind ViewModel.PathSegments}">
            <BreadcrumbBar.ItemTemplate>
                <DataTemplate x:DataType="models:WebDavPathSegment">
                    <TextBlock Style="{StaticResource BodyStrongTextBlockStyle}" Text="{x:Bind Name}" />
                </DataTemplate>
            </BreadcrumbBar.ItemTemplate>
        </BreadcrumbBar>
        <Button
            Grid.Column="1"
            Padding="12,8"
            VerticalAlignment="Center"
            AutomationProperties.Name="{ext:Locale Name=Refresh}"
            Command="{x:Bind ViewModel.RefreshCommand}">
            <StackPanel Orientation="Horizontal" Spacing="8">
                <ic:SymbolIcon
                    VerticalAlignment="Center"
                    FontSize="14"
                    Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
                    Symbol="ArrowSync" />
                <TextBlock
                    VerticalAlignment="Center"
                    Text="{ext:Locale Name=Refresh}"
                    TextLineBounds="Tight" />
            </StackPanel>
        </Button>
    </Grid>
</local:WebDavPageControlBase>
