"use client";

import { ComponentRegistry } from "../../ComponentRegistry";
import { TableSearchWidget } from "./TableSearchWidget";
import { TableSearchWidgetRenderer } from "./TableSearchWidgetRenderer";
import { V2TableSearchWidgetConfigPanel } from "@/components/v2/config-panels/V2TableSearchWidgetConfigPanel";

// 검색 필터 위젯 등록 (v2)
ComponentRegistry.registerComponent({
  id: "v2-table-search-widget",
  name: "검색 필터",
  nameEng: "Table Search Widget",
  category: "utility", // 유틸리티 컴포넌트로 분류
  description: "화면 내 테이블을 자동 감지하여 검색, 필터, 그룹 기능을 제공하는 위젯",
  icon: "Search",
  tags: ["table", "search", "filter", "group", "search-widget"],
  webType: "custom",
  defaultSize: { width: 1920, height: 80 }, // 픽셀 단위: 전체 너비 × 80px 높이
  component: TableSearchWidget,
  defaultProps: {
    title: "테이블 검색",
    style: {
      width: "100%",
      height: "80px",
      padding: "0.75rem",
    },
    componentConfig: {
      autoSelectFirstTable: true,
      showTableSelector: true,
    },
  },
  renderer: TableSearchWidgetRenderer.render,
  configPanel: V2TableSearchWidgetConfigPanel,
  version: "1.0.0",
  author: "WACE",
});

export { TableSearchWidget } from "./TableSearchWidget";
export { TableSearchWidgetRenderer } from "./TableSearchWidgetRenderer";
export { TableSearchWidgetConfigPanel } from "./TableSearchWidgetConfigPanel";

