"use client";

import React from "react";
import { AutoRegisteringComponentRenderer } from "../../AutoRegisteringComponentRenderer";
import { V2BomTreeDefinition } from "./index";
import { BomTreeComponent } from "./BomTreeComponent";

export class BomTreeRenderer extends AutoRegisteringComponentRenderer {
  static componentDefinition = V2BomTreeDefinition;

  render(): React.ReactElement {
    return <BomTreeComponent {...this.props} />;
  }
}

BomTreeRenderer.registerSelf();

if (typeof window !== "undefined") {
  setTimeout(() => {
    try {
      BomTreeRenderer.registerSelf();
    } catch (error) {
      console.error("BomTree 등록 실패:", error);
    }
  }, 1000);
}
