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

Function IconItem

packages/dev/s2-docs/src/IconSearchView.tsx:182–211  ·  view source on GitHub ↗
({item, isCopied = false}: {item: (typeof iconList)[number]; isCopied?: boolean})

Source from the content-addressed store, hash-verified

180}
181
182function IconItem({item, isCopied = false}: {item: (typeof iconList)[number]; isCopied?: boolean}) {
183 let Icon = item.icon;
184 let ref = useRef(null);
185 // oxlint-disable react/react-compiler
186 return (
187 <ListBoxItem
188 id={item.id}
189 value={item}
190 textValue={item.id}
191 className={itemStyle}
192 ref={ref}
193 style={pressScale(ref)}>
194 {isCopied ? (
195 <CheckmarkCircle styles={iconStyle({size: 'XL'})} />
196 ) : (
197 <Icon styles={iconStyle({size: 'XL'})} />
198 )}
199 <div
200 className={style({
201 maxWidth: '100%',
202 textOverflow: 'ellipsis',
203 overflow: 'hidden',
204 whiteSpace: 'nowrap'
205 })}>
206 {isCopied ? 'Copied!' : item.id}
207 </div>
208 </ListBoxItem>
209 );
210 // oxlint-enable react/react-compiler
211}
212
213export function SkeletonIconItem({item}: {item: {id: string}}) {
214 const PlaceholderIcon = Close;

Callers

nothing calls this directly

Calls 2

pressScaleFunction · 0.90
iconStyleFunction · 0.90

Tested by

no test coverage detected