"use client";

import React from "react";
import { AutoRegisteringComponentRenderer } from "../../AutoRegisteringComponentRenderer";
import { TableDefinition } from "./index";
import { TableComponent } from "./TableComponent";

/**
 * Table 렌더러
 *
 * AutoRegisteringComponentRenderer 상속으로 자동 등록.
 */
export class TableRenderer extends AutoRegisteringComponentRenderer {
  static componentDefinition = TableDefinition;

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

// 자동 등록
TableRenderer.registerSelf();

// Hot reload (dev)
if (process.env.NODE_ENV === "development") {
  TableRenderer.enableHotReload();
}
