'use client'; import React, { useState } from 'react'; interface DashboardToolbarProps { onClearCanvas: () => void; onSaveLayout: () => void; canvasBackgroundColor: string; onCanvasBackgroundColorChange: (color: string) => void; } /** * 대시보드 툴바 컴포넌트 * - 전체 삭제, 레이아웃 저장 등 주요 액션 버튼 */ export function DashboardToolbar({ onClearCanvas, onSaveLayout, canvasBackgroundColor, onCanvasBackgroundColorChange }: DashboardToolbarProps) { const [showColorPicker, setShowColorPicker] = useState(false); return (
{/* 캔버스 배경색 변경 버튼 */}
{/* 색상 선택 패널 */} {showColorPicker && (
onCanvasBackgroundColorChange(e.target.value)} className="h-10 w-16 border border-gray-300 rounded cursor-pointer" /> onCanvasBackgroundColorChange(e.target.value)} placeholder="#ffffff" className="flex-1 px-2 py-1 text-sm border border-gray-300 rounded" />
{/* 프리셋 색상 */}
{[ '#ffffff', '#f9fafb', '#f3f4f6', '#e5e7eb', '#3b82f6', '#8b5cf6', '#ec4899', '#f59e0b', '#10b981', '#06b6d4', '#6366f1', '#84cc16', ].map((color) => (
)}
); }