import { useState } from 'react' import { FolderOpen, Plus, AlertTriangle, Loader2 } from 'lucide-react' interface WelcomeScreenProps { mode: 'welcome' | 'vault-missing' missingPath?: string defaultVaultPath: string onCreateVault: () => void onOpenFolder: () => void creating: boolean error: string | null } const CONTAINER_STYLE: React.CSSProperties = { width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'var(--sidebar)', } const CARD_STYLE: React.CSSProperties = { width: 520, background: 'var(--background)', borderRadius: 12, border: '1px solid var(--border)', padding: 48, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 24, } const ICON_WRAP_STYLE: React.CSSProperties = { width: 64, height: 64, borderRadius: 16, display: 'flex', alignItems: 'center', justifyContent: 'center', } const TITLE_STYLE: React.CSSProperties = { fontSize: 28, fontWeight: 700, letterSpacing: -0.5, color: 'var(--foreground)', textAlign: 'center', margin: 0, } const SUBTITLE_STYLE: React.CSSProperties = { fontSize: 14, lineHeight: 1.6, color: 'var(--muted-foreground)', textAlign: 'center', margin: 0, } const DIVIDER_STYLE: React.CSSProperties = { width: '100%', height: 1, background: 'var(--border)', } const PRIMARY_BTN_STYLE: React.CSSProperties = { width: '100%', height: 44, borderRadius: 8, border: 'none', background: 'var(--primary)', color: 'white', fontSize: 14, fontWeight: 600, cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8, } const SECONDARY_BTN_STYLE: React.CSSProperties = { width: '100%', height: 44, borderRadius: 8, border: '1px solid var(--border)', background: 'var(--background)', color: 'var(--foreground)', fontSize: 14, fontWeight: 500, cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8, } const HINT_STYLE: React.CSSProperties = { fontSize: 12, color: 'var(--muted-foreground)', textAlign: 'center', margin: 0, } const PATH_BADGE_STYLE: React.CSSProperties = { width: '100%', background: 'var(--sidebar)', borderRadius: 6, padding: '8px 12px', textAlign: 'center', } const ERROR_STYLE: React.CSSProperties = { fontSize: 13, color: 'var(--destructive, #e03e3e)', textAlign: 'center', margin: 0, } export function WelcomeScreen({ mode, missingPath, defaultVaultPath, onCreateVault, onOpenFolder, creating, error }: WelcomeScreenProps) { const [hoverPrimary, setHoverPrimary] = useState(false) const [hoverSecondary, setHoverSecondary] = useState(false) const isWelcome = mode === 'welcome' return (
{isWelcome ? 'Wiki-linked knowledge management for deep thinkers.\nChoose how to get started.' : 'The vault folder could not be found on disk.\nIt may have been moved or deleted.' }
{missingPath}
{error}
} {isWelcome && !error && (The Getting Started vault will be created in {defaultVaultPath}
)}