import { Text, View } from 'react-native' import { useMobileTranslation } from '../i18n/use-mobile-translation' import type { SetupDecision as WorkspaceCreateSetupDecision } from '../../../src/shared/worktree/create-types' import { useMobileColorScheme } from '../theme/use-mobile-color-scheme' import { MobileSwitch } from './MobileSwitch' import { ListGroup, ListRow } from './list/ListGroup' 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} ) }