"use client"; import React from "react"; import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { Switch } from "@/components/ui/switch"; import { Separator } from "@/components/ui/separator"; import { Textarea } from "@/components/ui/textarea"; interface ShippingPlanEditorConfigPanelProps { config: any; onChange: (config: any) => void; } export const ShippingPlanEditorConfigPanel: React.FC< ShippingPlanEditorConfigPanelProps > = ({ config, onChange }) => { const handleChange = (key: string, value: any) => { onChange({ ...config, [key]: value }); }; const handleSummaryCardToggle = (cardKey: string, checked: boolean) => { onChange({ ...config, visibleSummaryCards: { ...(config.visibleSummaryCards || defaultSummaryCards), [cardKey]: checked, }, }); }; const defaultSummaryCards = { totalBalance: true, totalPlanQty: true, currentStock: true, availableStock: true, inProductionQty: true, }; const summaryCards = config.visibleSummaryCards || defaultSummaryCards; const summaryCardLabels: Record = { totalBalance: "총수주잔량", totalPlanQty: "총출하계획량", currentStock: "현재고", availableStock: "가용재고", inProductionQty: "생산중수량", }; return (
{/* 기본 설정 */}
기본 설정
handleChange("title", e.target.value)} placeholder="출하계획 등록" className="h-8 text-xs" />
{/* 표시 설정 */}
표시 설정
handleChange("showSummaryCards", checked) } />
handleChange("showExistingPlans", checked) } />
{config.showSummaryCards !== false && ( <>
집계 카드 항목
{Object.entries(summaryCardLabels).map(([key, label]) => (
handleSummaryCardToggle(key, checked) } />
))}
)} {/* 저장 설정 */}
저장 설정
handleChange("allowOverPlan", checked) } />
handleChange("autoCloseOnSave", checked) } />
handleChange("confirmBeforeSave", checked) } />
{config.confirmBeforeSave && (