"use client";

import React from "react";
import { AutoRegisteringComponentRenderer } from "../../AutoRegisteringComponentRenderer";
import { StatsDefinition } from "./index";
import { StatsComponent } from "./StatsComponent";

/**
 * Stats 렌더러
 *
 * AutoRegisteringComponentRenderer 상속으로 자동 등록.
 */
export class StatsRenderer extends AutoRegisteringComponentRenderer {
  static componentDefinition = StatsDefinition;

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

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

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