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

Function IconItem

packages/dev/s2-docs/src/IconSearchView.tsx:182–209  ·  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 return (
186 <ListBoxItem
187 id={item.id}
188 value={item}
189 textValue={item.id}
190 className={itemStyle}
191 ref={ref}
192 style={pressScale(ref)}>
193 {isCopied ? (
194 <CheckmarkCircle styles={iconStyle({size: 'XL'})} />
195 ) : (
196 <Icon styles={iconStyle({size: 'XL'})} />
197 )}
198 <div
199 className={style({
200 maxWidth: '100%',
201 textOverflow: 'ellipsis',
202 overflow: 'hidden',
203 whiteSpace: 'nowrap'
204 })}>
205 {isCopied ? 'Copied!' : item.id}
206 </div>
207 </ListBoxItem>
208 );
209}
210
211export function SkeletonIconItem({item}: {item: {id: string}}) {
212 const PlaceholderIcon = Close;

Callers

nothing calls this directly

Calls 2

pressScaleFunction · 0.90
iconStyleFunction · 0.90

Tested by

no test coverage detected