import { GitBranch } from '@phosphor-icons/react' import { useState } from 'react' import { Button } from '@/components/ui/button' import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog' interface GitSetupDialogProps { open: boolean onInitGit: () => Promise onDismiss: () => void } export function GitSetupDialog({ open, onInitGit, onDismiss }: GitSetupDialogProps) { const [creating, setCreating] = useState(false) const [error, setError] = useState(null) const handleCreate = async () => { setCreating(true) setError(null) try { await onInitGit() } catch (err) { setError(err instanceof Error ? err.message : String(err)) setCreating(false) } } return ( { if (!nextOpen && !creating) onDismiss() }}>
Enable Git for this vault? You can keep using this vault without Git. History, sync, commits, and change views stay disabled until you initialize Git.
{error && (

{error}

)}
) }