import { ArrowLeft, Map as MapIcon } from "lucide-react"; import { AnimatePresence, motion, useReducedMotion } from "motion/react"; import type { ReactNode } from "react"; import { cn } from "@/shared/ui/cn"; import { OPERATIONAL_TIMELINE_LAYOUT } from "../operational-timeline/operational-timeline-model"; import { AnalysisArtifactWorkspace } from "./analysis-document-view"; import { ArtifactPeekBar } from "./artifact-peek-bar"; import { ARTIFACT_VIEW_CONTROL_BUTTON_CLASS_NAME, ARTIFACT_VIEW_CONTROL_SHELL_CLASS_NAME } from "./artifact-view-control-styles"; import type { AnalysisArtifact, ArtifactRequestedView, WorkbenchSurfaceMode } from "./workspace-model"; type WorkbenchMainFrameProps = { mapContent: ReactNode; mapOverlay?: ReactNode; timelineContent: ReactNode; timelineMode: "compact" | "expanded" | "summary"; timelineBottom: number; activeArtifact: AnalysisArtifact | null; pendingArtifact: AnalysisArtifact | null; surfaceMode: WorkbenchSurfaceMode; mapSplitAvailable: boolean; onOpenPendingArtifact: () => void; onDestroyPendingArtifact: () => void; onSetArtifactView: (view: ArtifactRequestedView) => void; onCollapseArtifact: () => void; onDestroyArtifact: () => void; }; export function WorkbenchMainFrame({ mapContent, mapOverlay, timelineContent, timelineMode, timelineBottom, activeArtifact, pendingArtifact, surfaceMode, mapSplitAvailable, onOpenPendingArtifact, onDestroyPendingArtifact, onSetArtifactView, onCollapseArtifact, onDestroyArtifact }: WorkbenchMainFrameProps) { const prefersReducedMotion = useReducedMotion(); const showMap = surfaceMode !== "focus"; const showArtifact = activeArtifact && surfaceMode !== "map_only"; const showArtifactViewControl = Boolean( activeArtifact && activeArtifact.mapRelation !== "none" && (surfaceMode === "focus" || surfaceMode === "map_only") ); const mapOnly = surfaceMode === "map_only"; const timelineTransition = prefersReducedMotion ? { duration: 0 } : { duration: 0.28, ease: [0.22, 1, 0.36, 1] as const }; const viewControlTransition = prefersReducedMotion ? { duration: 0 } : { duration: 0.18, ease: [0.22, 1, 0.36, 1] as const }; return (