"use client"; import { useState } from "react"; import { ClockConfig } from "../types"; import { Button } from "@/components/ui/button"; 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 { Separator } from "@/components/ui/separator"; interface ClockSettingsProps { config: ClockConfig; onSave: (config: ClockConfig) => void; onClose: () => void; } /** * 시계 위젯 설정 UI (Popover 내부용) * - 모달 없이 순수 설정 폼만 제공 */ export function ClockSettings({ config, onSave, onClose }: ClockSettingsProps) { const [localConfig, setLocalConfig] = useState(config); const handleSave = () => { onSave(localConfig); }; return (
{/* 헤더 */}

시계 설정

{/* 내용 - 스크롤 가능 */}
{/* 스타일 선택 */}
{[ { value: "digital", label: "디지털" }, { value: "analog", label: "아날로그" }, { value: "both", label: "둘 다" }, ].map((style) => ( ))}
{/* 타임존 선택 */}
{/* 테마 선택 */}
{[ { value: "light", label: "Light", gradient: "bg-gradient-to-br from-background to-muted", text: "text-foreground", }, { value: "dark", label: "Dark", gradient: "bg-gradient-to-br from-foreground to-foreground", text: "text-background", }, { value: "custom", label: "사용자", gradient: "bg-gradient-to-br from-primary to-primary/80", text: "text-primary-foreground", }, ].map((theme) => ( ))}
{/* 사용자 지정 색상 */} {localConfig.theme === "custom" && (
setLocalConfig({ ...localConfig, customColor: e.target.value })} className="h-10 w-16 cursor-pointer" /> setLocalConfig({ ...localConfig, customColor: e.target.value })} placeholder="#3b82f6" className="flex-1 font-mono text-xs" />
)}
{/* 옵션 토글 */}
{/* 날짜 표시 */}
📅
setLocalConfig({ ...localConfig, showDate: checked })} />
{/* 초 표시 */}
⏱️
setLocalConfig({ ...localConfig, showSeconds: checked })} />
{/* 24시간 형식 */}
🕐
setLocalConfig({ ...localConfig, format24h: checked })} />
{/* 푸터 */}
); }