"use client";

import { useRouter } from "next/navigation";
import { StandaloneMindmapView } from "@/components/editor/blocks/MindmapBlock";
import type { MindmapProjection } from "@/lib/mindmap/mindmap-projection";

type MindmapPageClientProps = {
  docId: string;
  mindmapId: string;
  initialProjection: MindmapProjection | null;
};

export default function MindmapPageClient({
  docId,
  mindmapId,
  initialProjection,
}: MindmapPageClientProps) {
  const router = useRouter();

  return (
    <div className="fixed inset-0 bg-white">
      <StandaloneMindmapView
        docId={docId}
        mindmapId={mindmapId}
        initialProjection={initialProjection}
        onExitFullscreen={() => router.push(`/documents/${docId}`)}
      />
    </div>
  );
}
