import { useState } from "react"; import { cn } from "@/lib/utils"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog"; export interface ImageLightboxProps { /** Screen / area name — used for the trigger, placeholder chrome, and the enlarged view title. */ label: string; /** Real screenshot. When omitted, a non-interactive faux-window placeholder is shown. */ src?: string; /** * When true (default), a real screenshot becomes clickable and enlarges into a * centred dialog. Set false for a static, non-interactive preview. */ zoomable?: boolean; /** Classes for the inline preview (sizing, visibility, etc.). */ className?: string; } /** Inline thumbnail: the real screenshot, or a faux browser-window placeholder. */ function Preview({ label, src, className, }: Pick) { if (src) { return ( {`${label} ); } return (
{label}
); } /** * Inline screen preview. Renders a screenshot (or a faux-window placeholder when * no `src` is given) and, when `zoomable`, enlarges the screenshot into a centred * dialog on click. Stops click propagation so it can live inside a clickable row * without also triggering the row's action. */ export function ImageLightbox({ label, src, zoomable = true, className, }: ImageLightboxProps) { const [open, setOpen] = useState(false); // No screenshot, or zoom disabled → static preview / placeholder. if (!src || !zoomable) { return ; } return ( <> {label} Feature screenshot preview {`${label} ); }