MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / Img

Function Img

apps/baseai.dev/src/components/Img.tsx:15–144  ·  view source on GitHub ↗
({
	width,
	height,
	src,
	alt,
	caption,
	light,
	dark,
	...props
}: ImgProps)

Source from the content-addressed store, hash-verified

13}
14
15export default function Img({
16 width,
17 height,
18 src,
19 alt,
20 caption,
21 light,
22 dark,
23 ...props
24}: ImgProps) {
25 const finalAlt = alt || caption;
26
27 return (
28 <>
29 <Dialog>
30 <DialogTrigger asChild>
31 <figure
32 className="not-prose relative cursor-zoom-in"
33 style={{ marginBlock: '40px' }}
34 >
35 <div className="not-prose relative overflow-hidden rounded-xl bg-background p-2 ring-2 ring-border">
36 <div className="relative flex h-full w-full justify-center overflow-hidden rounded-lg">
37 {src && (
38 <img
39 alt={finalAlt}
40 src={src}
41 width={width}
42 height={height}
43 style={{
44 width: '100%',
45 height: 'auto',
46 color: 'transparent'
47 }}
48 className="block max-w-full rounded-md object-cover shadow"
49 />
50 )}
51 {light && (
52 <img
53 alt={finalAlt}
54 src={light}
55 loading="lazy"
56 width={width}
57 height={height}
58 style={{
59 width: '100%',
60 height: 'auto',
61 color: 'transparent'
62 }}
63 className="block max-w-full rounded-md object-cover shadow dark:hidden"
64 />
65 )}
66 {dark && (
67 <img
68 alt={finalAlt}
69 src={dark}
70 loading="lazy"
71 width={width}
72 height={height}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected