"use client"; import { useDrag } from "react-dnd"; import { Type, Table, Tag, Image, Minus, PenLine, Stamp as StampIcon } from "lucide-react"; interface ComponentItem { type: string; label: string; icon: React.ReactNode; } const COMPONENTS: ComponentItem[] = [ { type: "text", label: "텍스트", icon: }, { type: "table", label: "테이블", icon: }, { type: "label", label: "레이블", icon: }, { type: "image", label: "이미지", icon: }, { type: "divider", label: "구분선", icon: }, { type: "signature", label: "서명란", icon: }, { type: "stamp", label: "도장란", icon: }, ]; function DraggableComponentItem({ type, label, icon }: ComponentItem) { const [{ isDragging }, drag] = useDrag(() => ({ type: "component", item: { componentType: type }, collect: (monitor) => ({ isDragging: monitor.isDragging(), }), })); return (
{icon} {label}
); } export function ComponentPalette() { return (
{COMPONENTS.map((component) => ( ))}
); }