"use client"; import { useState, useEffect } from "react"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Separator } from "@/components/ui/separator"; import { Palette, Type, Square } from "lucide-react"; import { ComponentStyle } from "@/types/screen"; import { ColorPickerWithTransparent } from "./common/ColorPickerWithTransparent"; export default function StyleEditor({ style, onStyleChange, className }: StyleEditorProps) { const [localStyle, setLocalStyle] = useState(style || {}); useEffect(() => { setLocalStyle(style || {}); }, [style]); const handleStyleChange = (property: keyof ComponentStyle, value: any) => { const newStyle = { ...localStyle, [property]: value }; setLocalStyle(newStyle); onStyleChange(newStyle); }; return (
{/* 테두리 섹션 */}

테두리

handleStyleChange("borderWidth", e.target.value)} className="h-6 w-full px-2 py-0 text-xs" />
handleStyleChange("borderColor", value)} defaultColor="#e5e7eb" placeholder="#e5e7eb" />
handleStyleChange("borderRadius", e.target.value)} className="h-6 w-full px-2 py-0 text-xs" />
{/* 배경 섹션 */}

배경

handleStyleChange("backgroundColor", value)} defaultColor="#ffffff" placeholder="#ffffff" />
handleStyleChange("backgroundImage", e.target.value)} className="h-6 w-full px-2 py-0 text-xs" />

위젯 배경 꾸미기용 (고급 사용자 전용)

{/* 텍스트 섹션 */}

텍스트

handleStyleChange("color", value)} defaultColor="#000000" placeholder="#000000" />
handleStyleChange("fontSize", e.target.value)} className="h-6 w-full px-2 py-0 text-xs" />
); }