"use client";

import dynamic from "next/dynamic";
import type { ComponentProps } from "react";
import type ArchipelagoGlobeType from "./ArchipelagoGlobe";

/** Three.js and the globe data are code-split and only loaded on the client. */
const ArchipelagoGlobe = dynamic(() => import("./ArchipelagoGlobe"), {
  ssr: false,
  loading: () => (
    <div className="relative flex aspect-square w-full items-center justify-center" aria-hidden="true">
      <div className="h-[84%] w-[84%] rounded-full bg-[radial-gradient(circle_at_40%_35%,#123d7a,#061a38_70%)] opacity-70" />
    </div>
  ),
});

export default function GlobeLoader(props: ComponentProps<typeof ArchipelagoGlobeType>) {
  return <ArchipelagoGlobe {...props} />;
}
