"use client"; import { useState } from "react"; import { ClockConfig } from "../types"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Switch } from "@/components/ui/switch"; import { Input } from "@/components/ui/input"; import { Card } from "@/components/ui/card"; import { X } from "lucide-react"; interface ClockConfigModalProps { config: ClockConfig; onSave: (config: ClockConfig) => void; onClose: () => void; } /** * 시계 위젯 설정 모달 * - 스타일 선택 (아날로그/디지털/둘다) * - 타임존 선택 * - 테마 선택 * - 옵션 토글 (날짜, 초, 24시간) */ export function ClockConfigModal({ config, onSave, onClose }: ClockConfigModalProps) { const [localConfig, setLocalConfig] = useState(config); const handleSave = () => { onSave(localConfig); onClose(); }; return ( 시계 위젯 설정 {/* 내용 - 스크롤 가능 */}
{/* 스타일 선택 */}
{[ { value: "digital", label: "디지털", icon: "🔢" }, { value: "analog", label: "아날로그", icon: "🕐" }, { value: "both", label: "둘 다", icon: "⏰" }, ].map((style) => ( ))}
{/* 타임존 선택 */}
{/* 테마 선택 */}
{[ { value: "light", label: "Light", gradient: "bg-gradient-to-br from-white to-gray-100", text: "text-gray-900", }, { value: "dark", label: "Dark", gradient: "bg-gradient-to-br from-gray-800 to-gray-900", text: "text-white", }, { value: "custom", label: "사용자 지정", gradient: "bg-gradient-to-br from-blue-400 to-purple-600", text: "text-white", }, ].map((theme) => ( ))}
{/* 사용자 지정 색상 선택 */} {localConfig.theme === "custom" && (
setLocalConfig({ ...localConfig, customColor: e.target.value })} className="h-12 w-20 cursor-pointer" />
setLocalConfig({ ...localConfig, customColor: e.target.value })} placeholder="#3b82f6" className="font-mono" />

시계의 배경색이나 강조색으로 사용됩니다

)}
{/* 옵션 토글 */}
{/* 날짜 표시 */} 📅 setLocalConfig({ ...localConfig, showDate: checked })} /> {/* 초 표시 */} ⏱️ setLocalConfig({ ...localConfig, showSeconds: checked })} /> {/* 24시간 형식 */} 🕐 setLocalConfig({ ...localConfig, format24h: checked })} />
); }