"use client"; import React from "react"; import type { ButtonConfig } from "./types"; import { IconPicker } from "../common/IconPicker"; /** * Button ConfigPanel — V2PropertiesPanel 에서 호출되는 설정 패널. * * text / variant / size / actionType / confirm / 색상 / 아이콘 편집. * Phase A-3 의 최소 구현; Phase F 에서 아이콘 선택기 / action flow 연결 등 확장. */ export interface ButtonConfigPanelProps { config?: ButtonConfig; onChange?: (config: ButtonConfig) => void; onUpdateProperty?: (componentId: string, path: string, value: unknown) => void; selectedComponent?: { id: string; config?: ButtonConfig; [k: string]: any }; } export const ButtonConfigPanel: React.FC = ({ config, onChange, selectedComponent, }) => { const current: ButtonConfig = (config as ButtonConfig) || (selectedComponent?.config as ButtonConfig) || {}; const patch = (p: Partial) => { onChange?.({ ...current, ...p }); }; return (
patch({ text: e.target.value })} placeholder="버튼" className="border-border bg-background w-full rounded border px-2 py-1 text-xs" />
patch({ confirm: e.target.value || undefined })} placeholder="비우면 즉시 실행" className="border-border bg-background w-full rounded border px-2 py-1 text-xs" />
patch({ backgroundColor: e.target.value })} className="border-border bg-background h-7 w-full rounded border px-1" />
patch({ textColor: e.target.value })} className="border-border bg-background h-7 w-full rounded border px-1" />
patch({ borderRadius: e.target.value })} placeholder="6px" className="border-border bg-background w-full rounded border px-2 py-1 text-xs" />
patch({ icon: v || undefined })} /> {current.icon && ( )}
); }; export default ButtonConfigPanel;