/**
 * MF expose wrapper for the Online Board feature.
 *
 * Lazy-loads the OnlineBoardStartPage via React.lazy + Suspense.
 * Full MF integration with host routing is deferred to a later phase;
 * for now this renders the start page for embedded usage.
 */

import { lazy, Suspense } from "react";
import type { HostContract } from "@/host-contract";

const OnlineBoardStartPage = lazy(() =>
  import("@/features/online-board/components/OnlineBoardStartPage.js").then(
    (m) => ({ default: m.OnlineBoardStartPage }),
  ),
);

export interface OnlineBoardRemoteProps {
  hostContract: HostContract;
}

export default function OnlineBoardRemote(_props: OnlineBoardRemoteProps): JSX.Element {
  return (
    <div data-mf-expose="OnlineBoard">
      <Suspense fallback={<div aria-busy="true">Loading Online Board...</div>}>
        <OnlineBoardStartPage />
      </Suspense>
    </div>
  );
}
