"use client"; import { useState } from "react"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Button } from "@/components/ui/button"; import { ChevronRight, Puzzle, FileText, PanelLeftClose, PanelLeftOpen } from "lucide-react"; import { ComponentPalette } from "./ComponentPalette"; import { TemplatePalette } from "./TemplatePalette"; import { useReportDesigner } from "@/contexts/ReportDesignerContext"; interface AccordionSection { id: string; label: string; icon: React.ReactNode; } const SECTIONS: AccordionSection[] = [ { id: "templates", label: "기본 템플릿", icon: }, { id: "components", label: "컴포넌트", icon: }, ]; export function ReportDesignerLeftPanel() { const [expandedSection, setExpandedSection] = useState("components"); const { isLeftPanelCollapsed, setIsLeftPanelCollapsed } = useReportDesigner(); const toggleSection = (id: string) => { setExpandedSection(expandedSection === id ? "" : id); }; if (isLeftPanelCollapsed) { return (
{SECTIONS.map((section) => ( ))}
); } return (
도구상자
{SECTIONS.map((section) => { const isExpanded = expandedSection === section.id; return (
{isExpanded && (
{section.id === "templates" && } {section.id === "components" && }
)}
); })}
); }