<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="using:ClaudeDo.Ui.ViewModels.Modals"
        xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
        xmlns:loc="using:ClaudeDo.Ui.Localization"
        x:Class="ClaudeDo.Ui.Views.Modals.WorkerConnectionModalView"
        x:DataType="vm:WorkerConnectionModalViewModel"
        Title="{loc:Tr modals.workerConnection.title}"
        Width="520" Height="240"
        WindowDecorations="None"
        ExtendClientAreaToDecorationsHint="True"
        WindowStartupLocation="CenterOwner"
        Background="{DynamicResource SurfaceBrush}">
  <Window.KeyBindings>
    <KeyBinding Gesture="Escape" Command="{Binding CloseCommand}"/>
  </Window.KeyBindings>

  <ctl:ModalShell Title="{loc:Tr modals.workerConnection.title}" CloseCommand="{Binding CloseCommand}">
    <Grid RowDefinitions="*,Auto" Margin="20,16">
      <TextBlock Grid.Row="0" Classes="meta" TextWrapping="Wrap"
                 Text="{loc:Tr modals.workerConnection.body}"/>
      <StackPanel Grid.Row="1" Orientation="Horizontal" Spacing="8"
                  HorizontalAlignment="Right" Margin="0,16,0,0">
        <Button Classes="btn" Content="{loc:Tr modals.workerConnection.dismiss}" Command="{Binding CloseCommand}"/>
        <Button Classes="btn" Content="{loc:Tr modals.workerConnection.rerunInstaller}" Command="{Binding RerunInstallerCommand}"/>
        <Button Classes="btn primary" Content="{loc:Tr modals.workerConnection.startWorker}" Command="{Binding StartWorkerCommand}"/>
      </StackPanel>
    </Grid>
  </ctl:ModalShell>
</Window>
