import { Link } from "../../lib/navigation";
import { ArrowLeftIcon, XIcon } from "lucide-react";
import type { ReactNode } from "react";
import { Button } from "../../../ui/button";
import { useArtifactsBackLink } from "../artifacts/artifact-page-chrome";
import { ArtifactBrowseControls } from "../artifacts/artifact-browse-controls";
/** Explicit, reload-safe navigation for full-page artifacts (never embedded viewers). */
export function ArtifactSessionPage({
workspaceId,
artifactId,
fromSession,
showAllArtifacts = false,
children,
}: {
workspaceId: string;
artifactId?: string | undefined;
fromSession?: string | undefined;
/** Opt in when the detail content does not already own its library link. */
showAllArtifacts?: boolean | undefined;
children: ReactNode;
}) {
if (!fromSession && !showAllArtifacts && !artifactId) return children;
return (