"use client"; import { useRef, type ReactNode, type RefCallback, type RefObject, } from "react"; import { Dialog } from "@/components/ui/dialog"; import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"; import { LineChart } from "lucide-react"; interface DiveProfileFullscreenProps { open: boolean; onClose: () => void; // The button that opened it takes focus back when it closes. returnFocusRef: RefObject; // The channel menu and the button out, on the title row. controls: ReactNode; readout: ReactNode; // On the box the plot fills, which the chart measures to size its viewBox. plotRef: RefCallback; children: ReactNode; } // The profile filling the screen, with the readout beside the plot instead of // over it: above on a screen held upright, to the left on one turned sideways, // so a finger scrubbing the plot never covers the numbers it is reading. // // A Base UI dialog for what a modal owes - Escape, a focus trap, the page behind // locked and hidden from a screen reader - but not `ui/dialog`'s // `DialogContent`, whose centred, padded card for a form is everything this is // not. export function DiveProfileFullscreen({ open, onClose, returnFocusRef, controls, readout, plotRef, children, }: DiveProfileFullscreenProps) { const panelRef = useRef(null); return ( { if (!next) onClose(); }} > {/* The backdrop covers the page while the modal locks its scroll. */}
{controls}
{readout}
{children}
); }