"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, Box } from "lucide-react"; import { ComponentStyle } from "@/types/screen"; interface StyleEditorProps { style: ComponentStyle; onStyleChange: (style: ComponentStyle) => void; className?: string; } 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" style={{ fontSize: "12px" }} />
handleStyleChange("borderColor", e.target.value)} className="h-6 w-12 p-1" style={{ fontSize: "12px" }} /> handleStyleChange("borderColor", e.target.value)} placeholder="#000000" className="h-6 flex-1 text-xs" style={{ fontSize: "12px" }} />
handleStyleChange("borderRadius", e.target.value)} className="h-6 w-full px-2 py-0 text-xs" style={{ fontSize: "12px" }} />
{/* 배경 섹션 */}

배경

handleStyleChange("backgroundColor", e.target.value)} className="h-6 w-12 p-1" style={{ fontSize: "12px" }} /> handleStyleChange("backgroundColor", e.target.value)} placeholder="#ffffff" className="h-6 flex-1 text-xs" style={{ fontSize: "12px" }} />
handleStyleChange("backgroundImage", e.target.value)} className="h-6 w-full px-2 py-0 text-xs" style={{ fontSize: "12px" }} />
{/* 텍스트 섹션 */}

텍스트

handleStyleChange("color", e.target.value)} className="h-6 w-12 p-1" style={{ fontSize: "12px" }} /> handleStyleChange("color", e.target.value)} placeholder="#000000" className="h-6 flex-1 text-xs" style={{ fontSize: "12px" }} />
handleStyleChange("fontSize", e.target.value)} className="h-6 w-full px-2 py-0 text-xs" style={{ fontSize: "12px" }} />
); }