"use client"; /** * UnifiedLayout 설정 패널 * 통합 레이아웃 컴포넌트의 세부 설정을 관리합니다. */ import React from "react"; import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Separator } from "@/components/ui/separator"; import { Checkbox } from "@/components/ui/checkbox"; interface UnifiedLayoutConfigPanelProps { config: Record; onChange: (config: Record) => void; } export const UnifiedLayoutConfigPanel: React.FC = ({ config, onChange, }) => { // 설정 업데이트 핸들러 const updateConfig = (field: string, value: any) => { onChange({ ...config, [field]: value }); }; return (
{/* 레이아웃 타입 */}
{/* 그리드 설정 */} {(config.layoutType === "grid" || !config.layoutType) && (
updateConfig("use12Column", checked)} />
updateConfig("gap", e.target.value)} placeholder="16" className="h-8 text-xs" />
)} {/* 분할 패널 설정 */} {config.layoutType === "split" && (
updateConfig("splitRatio", [Number(e.target.value), 100 - Number(e.target.value)])} placeholder="50" min="10" max="90" className="h-8 text-xs" />
updateConfig("resizable", checked)} />
)} {/* 플렉스 설정 */} {config.layoutType === "flex" && (
updateConfig("gap", e.target.value)} placeholder="16" className="h-8 text-xs" />
updateConfig("wrap", checked)} />
)} {/* 화면 임베드 설정 */} {config.layoutType === "screen-embed" && (
updateConfig("screenId", e.target.value ? Number(e.target.value) : undefined)} placeholder="화면 ID" className="h-8 text-xs" />
)}
); }; UnifiedLayoutConfigPanel.displayName = "UnifiedLayoutConfigPanel"; export default UnifiedLayoutConfigPanel;