"use client"; import React from "react"; import { DragData, ElementType, ElementSubtype } from "./types"; /** * 대시보드 사이드바 컴포넌트 * - 드래그 가능한 차트/위젯 목록 * - 카테고리별 구분 */ export function DashboardSidebar() { // 드래그 시작 처리 const handleDragStart = (e: React.DragEvent, type: ElementType, subtype: ElementSubtype) => { const dragData: DragData = { type, subtype }; e.dataTransfer.setData("application/json", JSON.stringify(dragData)); e.dataTransfer.effectAllowed = "copy"; }; return (
{/* 차트 섹션 */}

📊 차트 종류

{/* 위젯 섹션 */}

🔧 위젯 종류

{/* 운영/작업 지원 섹션 */}

📋 운영/작업 지원

); } interface DraggableItemProps { icon: string; title: string; type: ElementType; subtype: ElementSubtype; className?: string; onDragStart: (e: React.DragEvent, type: ElementType, subtype: ElementSubtype) => void; } /** * 드래그 가능한 아이템 컴포넌트 */ function DraggableItem({ icon, title, type, subtype, className = "", onDragStart }: DraggableItemProps) { return (
onDragStart(e, type, subtype)} > {icon} {title}
); }