diff --git a/frontend/components/table-category/CategoryValueAddDialog.tsx b/frontend/components/table-category/CategoryValueAddDialog.tsx index 99aa02b1..c9a2b222 100644 --- a/frontend/components/table-category/CategoryValueAddDialog.tsx +++ b/frontend/components/table-category/CategoryValueAddDialog.tsx @@ -11,9 +11,33 @@ import { } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; +import { Badge } from "@/components/ui/badge"; import { TableCategoryValue } from "@/types/tableCategoryValue"; +// 기본 색상 팔레트 +const DEFAULT_COLORS = [ + "#ef4444", // red + "#f97316", // orange + "#f59e0b", // amber + "#eab308", // yellow + "#84cc16", // lime + "#22c55e", // green + "#10b981", // emerald + "#14b8a6", // teal + "#06b6d4", // cyan + "#0ea5e9", // sky + "#3b82f6", // blue + "#6366f1", // indigo + "#8b5cf6", // violet + "#a855f7", // purple + "#d946ef", // fuchsia + "#ec4899", // pink + "#64748b", // slate + "#6b7280", // gray +]; + interface CategoryValueAddDialogProps { open: boolean; onOpenChange: (open: boolean) => void; @@ -26,6 +50,7 @@ export const CategoryValueAddDialog: React.FC< > = ({ open, onOpenChange, onAdd, columnLabel }) => { const [valueLabel, setValueLabel] = useState(""); const [description, setDescription] = useState(""); + const [color, setColor] = useState("#3b82f6"); // 라벨에서 코드 자동 생성 const generateCode = (label: string): string => { @@ -59,13 +84,14 @@ export const CategoryValueAddDialog: React.FC< valueCode, valueLabel: valueLabel.trim(), description: description.trim(), - color: "#3b82f6", + color: color, isDefault: false, }); // 초기화 setValueLabel(""); setDescription(""); + setColor("#3b82f6"); }; return ( @@ -81,23 +107,56 @@ export const CategoryValueAddDialog: React.FC<
- setValueLabel(e.target.value)} - className="h-8 text-xs sm:h-10 sm:text-sm" - autoFocus - /> +
+ + setValueLabel(e.target.value)} + className="h-8 text-xs sm:h-10 sm:text-sm mt-1.5" + autoFocus + /> +
-