Files
cydweb/components/ui-preview.tsx
DESKTOP-PUHFO60\dsx2016 937c0090d5 Show on-device HTML UI mocks as firmware card previews.
Prefer media/preview.html over raster covers so catalog cards mirror each LVGL screen.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 22:10:05 +08:00

28 lines
620 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import { cn } from "@/lib/utils";
/** Scales an on-device HTML mock (320×240) into the card / detail media slot. */
export function UiPreview({
src,
className,
title,
}: {
src: string;
className?: string;
title?: string;
}) {
return (
<div className={cn("relative h-full w-full overflow-hidden bg-[#0a0806]", className)}>
<iframe
src={src}
title={title || "Firmware UI preview"}
className="pointer-events-none absolute inset-0 h-full w-full border-0"
loading="lazy"
sandbox="allow-scripts"
tabIndex={-1}
/>
</div>
);
}