'use client' import type { LevelNode } from '@pascal-app/core' import { useEffect, useState } from 'react' import type { LevelDuplicatePreset } from '../../lib/level-duplication' import { getLevelDisplayName } from '../../lib/level-name' import { cn } from '../../lib/utils' import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from './primitives/dialog' const DUPLICATE_PRESETS: Array<{ id: LevelDuplicatePreset label: string description: string }> = [ { id: 'everything', label: 'Everything', description: 'Structure, materials, furniture, and references.', }, { id: 'structure', label: 'Structure only', description: 'Walls, slabs, roofs, stairs, windows, and doors without finishes.', }, { id: 'structure-materials', label: 'Structure + materials', description: 'Structure with the current material and finish assignments.', }, { id: 'structure-furniture', label: 'Structure + furniture', description: 'Structure, finishes, and placed items, without guide references.', }, ] function getLevelLabel(level: LevelNode | null) { if (!level) return 'this level' return getLevelDisplayName(level) } export function LevelDuplicateDialog({ open, level, onConfirm, onOpenChange, }: { open: boolean level: LevelNode | null onConfirm: (preset: LevelDuplicatePreset) => void onOpenChange: (open: boolean) => void }) { const [preset, setPreset] = useState('everything') useEffect(() => { if (open) { setPreset('everything') } }, [open]) return ( Duplicate Level Choose what to copy from {getLevelLabel(level)}.
{DUPLICATE_PRESETS.map((option) => ( ))}
) }