Function
ChartIframe
({
src,
height,
title,
}: {
src: string
height: number
title: string
})
Source from the content-addressed store, hash-verified
| 5 | import { cn } from "@/lib/utils" |
| 6 | |
| 7 | export function ChartIframe({ |
| 8 | src, |
| 9 | height, |
| 10 | title, |
| 11 | }: { |
| 12 | src: string |
| 13 | height: number |
| 14 | title: string |
| 15 | }) { |
| 16 | const [loaded, setLoaded] = React.useState(false) |
| 17 | |
| 18 | return ( |
| 19 | <iframe |
| 20 | src={src} |
| 21 | className={cn( |
| 22 | "w-full border-none transition-opacity duration-300", |
| 23 | loaded ? "opacity-100" : "opacity-0" |
| 24 | )} |
| 25 | height={height} |
| 26 | loading="lazy" |
| 27 | title={title} |
| 28 | onLoad={() => setLoaded(true)} |
| 29 | /> |
| 30 | ) |
| 31 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected