48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
/**
|
||
|
|
* V2StatusCount 설정 패널
|
||
|
|
* 기존 StatusCountConfigPanel의 모든 로직(테이블/컬럼 Combobox, 동적 아이템 관리,
|
||
|
|
* 카테고리 값 자동 로드 등)을 유지하면서 componentConfigChanged 이벤트를 추가하여
|
||
|
|
* 실시간 업데이트 지원
|
||
|
|
*/
|
||
|
|
|
||
|
|
import React from "react";
|
||
|
|
import {
|
||
|
|
StatusCountConfigPanel,
|
||
|
|
} from "@/lib/registry/components/v2-status-count/StatusCountConfigPanel";
|
||
|
|
import type { StatusCountConfig } from "@/lib/registry/components/v2-status-count/types";
|
||
|
|
|
||
|
|
interface V2StatusCountConfigPanelProps {
|
||
|
|
config: StatusCountConfig;
|
||
|
|
onChange: (config: Partial<StatusCountConfig>) => void;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const V2StatusCountConfigPanel: React.FC<V2StatusCountConfigPanelProps> = ({
|
||
|
|
config,
|
||
|
|
onChange,
|
||
|
|
}) => {
|
||
|
|
const handleChange = (newConfig: Partial<StatusCountConfig>) => {
|
||
|
|
onChange(newConfig);
|
||
|
|
|
||
|
|
if (typeof window !== "undefined") {
|
||
|
|
window.dispatchEvent(
|
||
|
|
new CustomEvent("componentConfigChanged", {
|
||
|
|
detail: { config: { ...config, ...newConfig } },
|
||
|
|
})
|
||
|
|
);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
return (
|
||
|
|
<StatusCountConfigPanel
|
||
|
|
config={config}
|
||
|
|
onChange={handleChange}
|
||
|
|
/>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
V2StatusCountConfigPanel.displayName = "V2StatusCountConfigPanel";
|
||
|
|
|
||
|
|
export default V2StatusCountConfigPanel;
|