<UserControl x:Class="ClaudeDo.Installer.Pages.UiSettingsPage.UiSettingsPageView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:ClaudeDo.Installer.Pages.UiSettingsPage"
             xmlns:loc="clr-namespace:ClaudeDo.Installer.Localization"
             d:DataContext="{d:DesignInstance local:UiSettingsPageViewModel}"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d">

    <ScrollViewer VerticalScrollBarVisibility="Auto">
        <StackPanel MaxWidth="520">
            <TextBlock Text="{loc:Tr installer.uiSettings.title}" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
            <TextBlock Text="{loc:Tr installer.uiSettings.subtitle}"
                       Foreground="{StaticResource TextSecondaryBrush}" Margin="0,0,0,20"
                       TextWrapping="Wrap"/>

            <CheckBox Content="{loc:Tr installer.uiSettings.syncWithService}" IsChecked="{Binding IsSynced}" Margin="0,0,0,16"/>

            <Label Content="{loc:Tr installer.uiSettings.signalRUrl}"/>
            <TextBox Text="{Binding SignalRUrl, UpdateSourceTrigger=PropertyChanged}"
                     IsReadOnly="{Binding IsSynced}" Margin="0,0,0,12"/>

            <Label Content="{loc:Tr installer.paths.databasePath}"/>
            <TextBox Text="{Binding UiDbPath, UpdateSourceTrigger=PropertyChanged}"
                     IsReadOnly="{Binding IsSynced}" Margin="0,0,0,12"/>

            <TextBlock Text="{loc:Tr installer.uiSettings.syncHint}"
                       Foreground="{StaticResource TextDimBrush}" FontSize="11" TextWrapping="Wrap"
                       Visibility="{Binding IsSynced, Converter={StaticResource BoolToVisConverter}}"
                       Margin="0,0,0,12"/>

            <TextBlock Text="{Binding ValidationError}" Foreground="{StaticResource ErrorBrush}" FontSize="11"
                       Visibility="{Binding ValidationError, Converter={StaticResource NullToCollapsedConverter}}"/>
        </StackPanel>
    </ScrollViewer>
</UserControl>
