"use client";

import { createComponentDefinition } from "../../utils/createComponentDefinition";
import { ComponentCategory } from "@/types/component";
import { StatusCountWrapper } from "./StatusCountComponent";
import { V2StatusCountConfigPanel } from "@/components/v2/config-panels/V2StatusCountConfigPanel";

export const V2StatusCountDefinition = createComponentDefinition({
  id: "v2-status-count",
  name: "상태별 카운트",
  nameEng: "Status Count",
  description: "관련 테이블의 상태별 데이터 건수를 카드 형태로 표시하는 범용 컴포넌트",
  category: ComponentCategory.DISPLAY,
  webType: "text",
  component: StatusCountWrapper,
  configPanel: V2StatusCountConfigPanel,
  defaultConfig: {
    title: "상태 현황",
    tableName: "",
    statusColumn: "status",
    relationColumn: "",
    parentColumn: "",
    items: [
      { value: "ACTIVE", label: "사용중", color: "blue" },
      { value: "STANDBY", label: "대기", color: "green" },
      { value: "REPAIR", label: "수리중", color: "orange" },
      { value: "DISPOSED", label: "폐기", color: "red" },
    ],
    cardSize: "md",
  },
  defaultSize: { width: 800, height: 100 },
  icon: "BarChart3",
  tags: ["상태", "카운트", "통계", "현황", "v2"],
  version: "1.0.0",
  author: "개발팀",
});

export type { StatusCountConfig, StatusCountItem } from "./types";
