({variant, gradientStyle})
| 187 | } |
| 188 | |
| 189 | function IllustrationList({variant, gradientStyle}) { |
| 190 | let items = use(loadIllustrations(variant, gradientStyle)); |
| 191 | let {copiedId, handleCopyImport} = useCopyImport(variant, gradientStyle); |
| 192 | return ( |
| 193 | <Virtualizer |
| 194 | layout={GridLayout} |
| 195 | layoutOptions={{ |
| 196 | minItemSize: new Size(164, 164), |
| 197 | maxItemSize: new Size(164, 164), |
| 198 | minSpace: new Size(20, 20), |
| 199 | preserveAspectRatio: true |
| 200 | }}> |
| 201 | <ListBox |
| 202 | aria-label="Illustrations" |
| 203 | items={items} |
| 204 | layout="grid" |
| 205 | onAction={item => handleCopyImport(item.toString())} |
| 206 | dependencies={[copiedId]} |
| 207 | className={style({ |
| 208 | height: 560, |
| 209 | width: '100%', |
| 210 | maxHeight: '100%', |
| 211 | overflow: 'auto', |
| 212 | scrollPaddingY: 4 |
| 213 | })} |
| 214 | renderEmptyState={() => ( |
| 215 | <IllustratedMessage styles={style({marginX: 'auto', marginY: 32})}> |
| 216 | <NoSearchResults /> |
| 217 | <Heading>No results</Heading> |
| 218 | <Content>Try a different search term.</Content> |
| 219 | </IllustratedMessage> |
| 220 | )}> |
| 221 | {(item: IllustrationItemType) => ( |
| 222 | <IllustrationItem item={item} isCopied={copiedId === item.id} /> |
| 223 | )} |
| 224 | </ListBox> |
| 225 | </Virtualizer> |
| 226 | ); |
| 227 | } |
| 228 | |
| 229 | function IllustrationItem({ |
| 230 | item, |
nothing calls this directly
no test coverage detected