import React from "react";
import { createRoot } from "react-dom/client";
import VoxelUniverse, { metadata } from "./voxel_universe.js";

const rootElement = document.getElementById("root");

if (rootElement) {
  createRoot(rootElement).render(
    React.createElement(VoxelUniverse, {
      config: {
        id: "voxel-universe-hosted",
        name: metadata?.name ?? "voxel_universe",
        version: metadata?.version ?? "1.0.0",
        params: metadata?.defaultParams ?? {}
      },
      theme: {
        primary: "#45c4b0",
        accent: "#ff7a59",
        bg: "#0d1117",
        bgSecondary: "#182237",
        text: "#f1f4ef",
        textMuted: "#b6c0d4",
        border: "#34516f"
      },
      onProgress: () => {},
      onComplete: () => {}
    })
  );
}
