import type { createTranslator } from '../lib/i18n' import type { GitProviderId } from '../types' import { GitProviderSettingsRows } from './GitProviderSettingsRows' import { NumberInputControl, SectionHeading, SettingsGroup, SettingsRow, SettingsSwitchRow, } from './SettingsControls' type Translate = ReturnType interface GitSettingsSectionProps { autoGitEnabled: boolean autoGitIdleThresholdSeconds: number autoGitInactiveThresholdSeconds: number gitProvider: GitProviderId gitFeaturesEnabled: boolean gitWslDistro: string | null isGitVault: boolean setAutoGitEnabled: (value: boolean) => void setAutoGitIdleThresholdSeconds: (value: number) => void setAutoGitInactiveThresholdSeconds: (value: number) => void setGitFeaturesEnabled: (value: boolean) => void setGitProvider: (value: GitProviderId) => void setGitWslDistro: (value: string | null) => void t: Translate } function describeAutoGitAvailability( gitFeaturesEnabled: boolean, isGitVault: boolean, t: Translate, ): string { if (!gitFeaturesEnabled) return t('settings.autogit.description.gitDisabled') return isGitVault ? t('settings.autogit.description.enabled') : t('settings.autogit.description.disabled') } export function GitSettingsSection(props: GitSettingsSectionProps) { const { autoGitEnabled, autoGitIdleThresholdSeconds, autoGitInactiveThresholdSeconds, gitProvider, gitFeaturesEnabled, gitWslDistro, isGitVault, setAutoGitEnabled, setAutoGitIdleThresholdSeconds, setAutoGitInactiveThresholdSeconds, setGitFeaturesEnabled, setGitProvider, setGitWslDistro, t, } = props const gitControlsAvailable = gitFeaturesEnabled && isGitVault return ( <> ) }