"use client"; import * as React from "react"; import { cn } from "./lib/utils"; export interface BottomSheetProps extends React.HTMLAttributes { open?: boolean; onOpenChange?: (open: boolean) => void; title?: string; children?: React.ReactNode; } /** Mobile bottom sheet with pull handle and backdrop. */ export function BottomSheet({ open, onOpenChange, title = "Seat options", children, className, ...props }: BottomSheetProps) { const [inner, setInner] = React.useState(false); const visible = open ?? inner; const set = (v: boolean) => { setInner(v); onOpenChange?.(v); }; React.useEffect(() => { if (!visible) return; const onKey = (e: KeyboardEvent) => { if (e.key === "Escape") set(false); }; window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); }, [visible]); return (
{visible && (
{children ?? "Orchestra Row C, two seats held for 10 minutes."}
)} ); }