| 1 | import { Skeleton } from "@/components/ui/skeleton"; |
| 2 | |
| 3 | /** A page title over a bordered list, the shape of every list page while it loads. `avatar` rows lead with a picture, `detail` rows carry a second line. */ |
| 4 | export function ListSkeleton({ |
| 5 | rows = 6, |
| 6 | title = true, |
| 7 | avatar = false, |
| 8 | detail = false, |
| 9 | }: { |
| 10 | rows?: number |
| 11 | title?: boolean |
| 12 | avatar?: boolean |
| 13 | detail?: boolean |
| 14 | }) { |
| 15 | return ( |
| 16 | <div className="flex flex-col gap-4 |
| 17 | {title && <Skeleton |
| 18 | <ul className="divide-y rounded-lg border |
| 19 | {Array.from({ |
| 20 | <li key={index |
| 21 | <Skeleton className={ |
| 22 | <div className="flex flex-1 flex-col gap-1.5 |
| 23 | <Skeleton |
| 24 | className="h-4" |
| 25 | style={{ width: |
| 26 | /> |
| 27 | {detail && <Skeleton |
| 28 | </div> |
| 29 | <Skeleton className=" |
| 30 | </li> |
| 31 | ))} |
| 32 | </ul> |
| 33 | </div> |
| 34 | ); |
| 35 | } |