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

Function AIIconListBox

packages/dev/s2-docs/src/AIIconSearchView.tsx:205–232  ·  view source on GitHub ↗
({items, copiedId, onAction, listBoxClassName}: AIIconListBoxProps)

Source from the content-addressed store, hash-verified

203}
204
205function AIIconListBox({items, copiedId, onAction, listBoxClassName}: AIIconListBoxProps) {
206 return (
207 <Virtualizer
208 layout={GridLayout}
209 layoutOptions={{
210 minItemSize: new Size(64, 64),
211 maxItemSize: new Size(64, 64),
212 minSpace: new Size(12, 12),
213 preserveAspectRatio: true
214 }}>
215 <ListBox
216 onAction={item => onAction(item.toString())}
217 items={items}
218 layout="grid"
219 className={listBoxClassName || style({width: '100%', scrollPaddingY: 4, padding: 8})}
220 dependencies={[copiedId]}
221 renderEmptyState={() => (
222 <IllustratedMessage styles={style({marginX: 'auto', marginY: 32})}>
223 <NoSearchResults />
224 <Heading>No results</Heading>
225 <Content>Try a different search term.</Content>
226 </IllustratedMessage>
227 )}>
228 {item => <AIIconItem item={item} isCopied={copiedId === item.id} />}
229 </ListBox>
230 </Virtualizer>
231 );
232}
233
234export function AIIconsPageSearch() {
235 let {copiedId, handleCopyImport} = useCopyAIImport();

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.65
onActionFunction · 0.50

Tested by

no test coverage detected