"use client"; import type { DividerBlockProps } from "@/features/editor/state/editorStore"; import { NumericPropertyControl } from "@/features/editor/components/NumericPropertyControl"; import { ColorPickerField, TEXT_COLOR_PALETTE } from "@/features/editor/components/ColorPickerField"; import { useAppLocale } from "@/features/i18n/LocaleProvider"; import { getEditorDividerPropertiesPanelMessages } from "@/features/i18n/messages/editorDividerPropertiesPanel"; export type DividerPropertiesPanelProps = { dividerProps: DividerBlockProps; selectedBlockId: string; updateBlock: (id: string, partial: Partial) => void; }; export function DividerPropertiesPanel({ dividerProps, selectedBlockId, updateBlock }: DividerPropertiesPanelProps) { const locale = useAppLocale(); const m = getEditorDividerPropertiesPanelMessages(locale); return ( <>

{m.styleSectionTitle}

{/* 길이/너비 모드 */} {(dividerProps.widthMode ?? "full") === "fixed" && ( { updateBlock(selectedBlockId, { widthPx: v } as any); }} /> )} {/* 색상 */} { updateBlock(selectedBlockId, { colorHex: hex } as any); }} palette={TEXT_COLOR_PALETTE} onPaletteSelect={(item) => { updateBlock(selectedBlockId, { colorHex: item.color } as any); }} /> {/* 상하 여백 (슬라이더) */} { if (typeof dividerProps.marginYPx === "number") { return dividerProps.marginYPx; } const y = dividerProps.marginY ?? "md"; return y === "sm" ? 8 : y === "lg" ? 24 : 16; })()} min={0} max={50} step={2} presets={[ { id: "sm", label: m.marginPresetSmall, value: 8 }, { id: "md", label: m.marginPresetNormal, value: 16 }, { id: "lg", label: m.marginPresetLarge, value: 24 }, ]} onChangeValue={(v) => { updateBlock(selectedBlockId, { marginYPx: v } as any); }} />
); }