import { useStore } from '@nanostores/react' import { FileText, RefreshCw } from 'lucide-react' import { type CSSProperties } from 'react' import { Button } from '../components/button' import { $logPath, $mode, type BootstrapStateModel, openLogDir, startInstall, startUpdate } from '../store' interface FailureProps { bootstrap: BootstrapStateModel } /* * Failure screen. Same hero treatment as Welcome/Success — the wordmark * carries the brand, so we keep it across every terminal state. * * The actual error message lives below in muted text. Two affordances on * shared Button tokens: Retry (primary) and Open logs (quiet text link). */ export default function Failure({ bootstrap }: FailureProps) { const logPath = useStore($logPath) const mode = useStore($mode) const isUpdate = mode === 'update' return (
{isUpdate ? 'Update didn\u2019t finish' : 'Install didn\u2019t finish'}
{bootstrap.error ?? (isUpdate ? 'Something went wrong during the update.' : 'Something went wrong during installation.')}
Log: {logPath}