MCPcopy Index your code
hub / github.com/adobe/react-spectrum / Image

Function Image

packages/dev/docs/src/Image.js:72–88  ·  view source on GitHub ↗
({src, expandable, ...otherProps})

Source from the content-addressed store, hash-verified

70}
71
72export function Image({src, expandable, ...otherProps}) {
73 let publicUrl = React.useContext(ImageContext);
74 let baseUrl = publicUrl.replace(/\/$/, '');
75 let url = baseUrl + '/' + path.basename(src);
76
77 let className = clsx(docStyles.video, expandable && docStyles.expandableImage);
78
79 return (
80 // eslint-disable-next-line jsx-a11y/alt-text
81 <img
82 src={url}
83 className={className}
84 data-img={expandable ? 'expand-img' : null}
85 {...otherProps}
86 />
87 );
88}
89
90export function Video({src, ...otherProps}) {
91 let publicUrl = React.useContext(ImageContext);

Callers

nothing calls this directly

Calls 1

clsxFunction · 0.70

Tested by

no test coverage detected