MCPcopy Create free account
hub / github.com/adobe/react-spectrum / IllustrationItem

Function IllustrationItem

packages/dev/s2-docs/src/IllustrationCards.tsx:229–259  ·  view source on GitHub ↗
({
  item,
  isCopied = false
}: {
  item: IllustrationItemType;
  isCopied?: boolean;
})

Source from the content-addressed store, hash-verified

227}
228
229function IllustrationItem({
230 item,
231 isCopied = false
232}: {
233 item: IllustrationItemType;
234 isCopied?: boolean;
235}) {
236 let Illustration = item.Component;
237 let ref = useRef(null);
238 // oxlint-disable react/react-compiler
239 return (
240 <ListBoxItem
241 id={item.id}
242 value={item}
243 textValue={item.id}
244 className={itemStyle}
245 ref={ref}
246 style={pressScale(ref)}>
247 {isCopied ? <Checkmark /> : <Illustration />}
248 <div
249 className={style({
250 display: 'flex',
251 alignItems: 'center',
252 padding: 4
253 })}>
254 {isCopied ? 'Copied!' : item.id}
255 </div>
256 </ListBoxItem>
257 );
258 // oxlint-enable react/react-compiler
259}
260
261const cache = new Map();
262

Callers

nothing calls this directly

Calls 1

pressScaleFunction · 0.90

Tested by

no test coverage detected