import React from 'react' import { Box, Text } from 'ink' import { Surface } from '../../../ui/Surface.js' import { Select } from '../../../ui/Select.js' import { theme } from '../../../ui/theme.js' import type { ContinuityWorkingTreeStatus } from '../../continuity/storage.js' import { changedContinuitySnapshotFiles } from './state.js' type SavePromptAction = 'save-now' | 'later' interface SavePromptScreenProps { workingStatus?: ContinuityWorkingTreeStatus | null footer: React.ReactNode onSelect: (action: SavePromptAction) => void onCancel: () => void } export const SavePromptScreen: React.FC = ({ workingStatus, footer, onSelect, onCancel }) => { const files = changedContinuitySnapshotFiles(workingStatus) return ( {files.length > 0 ? ( Changed: {files.join(', ')} ) : ( Local files differ from the saved snapshot. )} options={[ { value: 'save-now', label: 'Save now', hint: 'Sign and save snapshot' }, { value: 'later', label: 'Not now', hint: 'Ask again next launch', role: 'utility' }, ]} hintLayout="inline" onSubmit={onSelect} onCancel={onCancel} /> ) }