import { ArrowLeftIcon } from "lucide-react"; import { Dialog } from "radix-ui"; import type { ReactNode } from "react"; import { Button } from "../../../ui/button"; import { containedPortal } from "../../../ui/portal-container"; const DialogContainedPortal = containedPortal(Dialog.Portal); /** * An artifact shown by itself across the whole window, with one bar: back to * its page, its name and its main action. It matches a Site's full screen, * including the desktop app's window-control clearance, so every artifact * expands the same way. A Radix dialog, so an image lightbox opened from it * stacks above it and Escape closes the innermost layer first. */ export function ArtifactFullView({ title, actions, onBack, children, }: { title: string; actions?: ReactNode | undefined; onBack: () => void; children: ReactNode; }) { return ( !open && onBack()}> event.preventDefault()} className="fixed inset-0 z-50 flex h-dvh w-dvw flex-col overflow-hidden bg-surface text-left text-fg outline-hidden" >
{title}
{actions ?
{actions}
: null}
{children}
); }