"use client";

import React from "react";
import { createComponentDefinition } from "../../utils/createComponentDefinition";
import { ComponentCategory } from "@/types/component";
import { V2WebViewWrapper } from "./V2WebViewComponent";
import { V2WebViewConfigPanel } from "@/components/v2/config-panels/V2WebViewConfigPanel";
import type { V2WebViewConfig } from "./types";

export const V2WebViewDefinition = createComponentDefinition({
  id: "v2-web-view",
  name: "V2 웹 뷰",
  nameEng: "V2 WebView Component",
  description: "외부 웹페이지를 iframe으로 임베드하여 표시하는 컴포넌트 (SSO 지원)",
  category: ComponentCategory.DISPLAY,
  webType: "custom",
  component: V2WebViewWrapper,
  defaultConfig: {
    url: "",
    useSSO: false,
    sandbox: true,
    allowFullscreen: false,
    showBorder: true,
    loadingText: "로딩 중...",
  } as V2WebViewConfig,
  defaultSize: { width: 600, height: 400 },
  configPanel: V2WebViewConfigPanel,
  icon: "Globe",
  tags: ["v2", "웹", "뷰", "iframe", "임베드", "외부", "SSO", "fleet"],
  version: "1.0.0",
  author: "개발팀",
});

export type { V2WebViewConfig } from "./types";
