Spaces:
Running
Running
Download client/components/Search/Results/Graphical/ImageResultsLoadingState.tsx from Felladrin/MiniSearch: direct link, hf CLI and curl.
- Browser
- Download file 587 Bytes
-
https://huggingface.co/spaces/Felladrin/MiniSearch/resolve/main/client/components/Search/Results/Graphical/ImageResultsLoadingState.tsx
- Command line
-
hf download hf://spaces/Felladrin/MiniSearch/client/components/Search/Results/Graphical/ImageResultsLoadingState.tsx
-
curl -L -o ImageResultsLoadingState.tsx https://huggingface.co/spaces/Felladrin/MiniSearch/resolve/main/client/components/Search/Results/Graphical/ImageResultsLoadingState.tsx
587 Bytes
| import { AspectRatio, em, Group, Skeleton } from "@mantine/core"; | |
| import { useMediaQuery } from "@mantine/hooks"; | |
| export default function ImageResultsLoadingState() { | |
| const hasSmallScreen = useMediaQuery(`(max-width: ${em(530)})`); | |
| const numberOfSquareSkeletons = hasSmallScreen ? 4 : 6; | |
| const skeletonIds = Array.from( | |
| { length: numberOfSquareSkeletons }, | |
| (_, i) => `skeleton-${i}`, | |
| ); | |
| return ( | |
| <Group> | |
| {skeletonIds.map((id) => ( | |
| <AspectRatio key={id} ratio={1} flex={1}> | |
| <Skeleton /> | |
| </AspectRatio> | |
| ))} | |
| </Group> | |
| ); | |
| } | |