'use client'; import { useRef } from 'react'; interface RecipeCardImageProps { src: string; alt: string; } // A card preview that enlarges to fill the screen when clicked. The native // sits above the tab's overflow clipping and handles Escape and focus; clicking // anywhere closes it. export default function RecipeCardImage({ src, alt }: RecipeCardImageProps) { const dialogRef = useRef(null); const open = () => { document.documentElement.style.overflow = 'hidden'; dialogRef.current?.showModal(); }; return ( <> dialogRef.current?.close()} onClose={() => { document.documentElement.style.overflow = ''; }} className="fixed inset-0 m-0 h-full max-h-none w-full max-w-none cursor-zoom-out bg-black/90 p-2 open:block" > ); }