"use client";

import { createComponentDefinition } from "../../utils/createComponentDefinition";
import { ComponentCategory } from "@/types/component";
import type { WebType } from "@/types/screen";
import { SplitPanelLayout2Wrapper } from "./SplitPanelLayout2Component";
import { SplitPanelLayout2ConfigPanel } from "./SplitPanelLayout2ConfigPanel";
import { defaultConfig, componentMeta } from "./config";

/**
 * SplitPanelLayout2 컴포넌트 정의
 * 마스터-디테일 패턴의 좌우 분할 레이아웃 (개선 버전)
 */
export const SplitPanelLayout2Definition = createComponentDefinition({
  id: componentMeta.id,
  name: componentMeta.name,
  nameEng: componentMeta.nameEng,
  description: componentMeta.description,
  category: ComponentCategory.LAYOUT,
  webType: componentMeta.webType as WebType,
  component: SplitPanelLayout2Wrapper,
  defaultConfig: defaultConfig,
  defaultSize: { width: 1200, height: 600 },
  configPanel: SplitPanelLayout2ConfigPanel,
  icon: componentMeta.icon,
  tags: componentMeta.tags,
  version: componentMeta.version,
  author: componentMeta.author,
  documentation: "https://docs.example.com/components/split-panel-layout2",
});

// 타입 내보내기
export type {
  SplitPanelLayout2Config,
  LeftPanelConfig,
  RightPanelConfig,
  JoinConfig,
  DataTransferField,
  ColumnConfig,
  ActionButtonConfig,
  ValueSourceConfig,
  EntityReferenceConfig,
  ModalParamMapping,
} from "./types";

// 모달 컴포넌트 내보내기 (별도 사용 필요시)
export { ColumnConfigModal } from "./ColumnConfigModal";
export { ActionButtonConfigModal } from "./ActionButtonConfigModal";

