import { Text, View } from 'react-native' import { useMobileTranslation } from '../i18n/use-mobile-translation' import type { WorkspaceCreateSetupDecision } from '../tasks/workspace-create-params' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { MobileSwitch } from './MobileSwitch' import { ListGroup } from './list/ListGroup' import { ListRow } from './list/ListRow' import { newWorktreeFormStyles as styles } from './new-worktree-form-styles' import type { SetupRunPolicy } from './new-worktree-modal-types' export function NewWorkspaceSetupScriptField({ command, source, runPolicy, decision, runSetup, onDecisionChange, onRunSetupChange }: { command: string source: string | null runPolicy: SetupRunPolicy decision: Exclude | null runSetup: boolean onDecisionChange: (decision: Exclude) => void onRunSetupChange: (run: boolean) => void }) { useMobileColorScheme() const t = useMobileTranslation() const runSetupLabel = t( 'components.newWorkspaceSetupScriptField.runSetupCommand', 'Run setup command' ) return ( {t('components.newWorkspaceSetupScriptField.label', 'Setup script')} {source ? ( {source === 'orca.yaml' ? 'ORCA.YAML' : t('components.newWorkspaceSetupScriptField.hooks', 'HOOKS')} ) : null} {runPolicy === 'ask' ? ( onDecisionChange('run')} /> onDecisionChange('skip')} /> ) : ( } /> )} {command} ) }