| 1 | "use client"; |
| 2 | |
| 3 | import { X } from "lucide-react"; |
| 4 | |
| 5 | import { Button } from "@/components/ui/button"; |
| 6 | import { usePresentationState } from "@/states/presentation-state"; |
| 7 | import { ChartEditorControls } from "./ChartEditorControls"; |
| 8 | |
| 9 | export function ChartEditorPanel() { |
| 10 | const closeChartEditor = usePresentationState((s) => s.closeChartEditor); |
| 11 | const currentSlideId = usePresentationState((s) => s.currentSlideId); |
| 12 | |
| 13 | if (!currentSlideId) { |
| 14 | return null; |
| 15 | } |
| 16 | |
| 17 | return ( |
| 18 | <div className="flex h-full w-full flex-col border-l bg-background"> |
| 19 | {/* Header */} |
| 20 | <div className="flex items-center justify-between border-b px-4 py-2"> |
| 21 | <h2 className="text-sm font-semibold">Chart Editor</h2> |
| 22 | <Button |
| 23 | variant="ghost" |
| 24 | size="icon" |
| 25 | onClick={closeChartEditor} |
| 26 | className="size-8 rounded-full p-0" |
| 27 | > |
| 28 | <X className="size-5" /> |
| 29 | </Button> |
| 30 | </div> |
| 31 | |
| 32 | {/* Main Content */} |
| 33 | <div className="min-h-0 flex-1 overflow-hidden"> |
| 34 | <ChartEditorControls slideId={currentSlideId} /> |
| 35 | </div> |
| 36 | </div> |
| 37 | ); |
| 38 | } |
| 39 |