'use client' import { useState } from 'react' import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/primitives/dialog' import type { LocalProject } from '../lib/local-storage/project-store' interface LocalProjectMigrationDialogProps { localProjects: LocalProject[] open: boolean onMigrate: () => Promise onSkip: () => void } export function LocalProjectMigrationDialog({ localProjects, open, onMigrate, onSkip, }: LocalProjectMigrationDialogProps) { const [isMigrating, setIsMigrating] = useState(false) const handleMigrate = async () => { setIsMigrating(true) try { await onMigrate() } finally { setIsMigrating(false) } } return ( !open && !isMigrating && onSkip()}> Save Local Projects to Cloud You have {localProjects.length} local {localProjects.length === 1 ? 'project' : 'projects'} that {localProjects.length === 1 ? 'hasn\'t' : 'haven\'t'} been saved to the cloud yet.

Would you like to save {localProjects.length === 1 ? 'it' : 'them'} to your account?

    {localProjects.map((project) => (
  • • {project.name}
  • ))}
) }