| 1 | "use client"; |
| 2 | |
| 3 | import Link from "next/link" |
| 4 | import { BookLock, BookMarked |
| 5 | import type { Repository |
| 6 | import { FromNowHoverCard } |
| 7 | import { Skeleton } |
| 8 | |
| 9 | /** One line per repository: the sidebar is too narrow for a card. */ |
| 10 | export function RepositoryRow({ |
| 11 | const fullName = |
| 12 | const Icon = |
| 13 | |
| 14 | return ( |
| 15 | <Link |
| 16 | href={`/${repository |
| 17 | title={fullName} |
| 18 | className="flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted" |
| 19 | > |
| 20 | <Icon |
| 21 | className="size-4 shrink-0 text-muted-foreground" |
| 22 | aria-label={repository.visibility |
| 23 | /> |
| 24 | <span className="min-w-0 flex-1 truncate |
| 25 | <span className="text-muted-foreground |
| 26 | <span className="font-medium |
| 27 | </span> |
| 28 | <FromNowHoverCard |
| 29 | date={repository.lastPushedAt |
| 30 | className="shrink-0 text-xs text-muted-foreground" |
| 31 | /> |
| 32 | </Link> |
| 33 | ); |
| 34 | } |
| 35 | |
| 36 | export function RepositoryRowSkeleton() |
| 37 | return ( |
| 38 | <div className="flex items-center gap-2 px-2 py-1.5 |
| 39 | <Skeleton className=" |
| 40 | <Skeleton className=" |
| 41 | <Skeleton className=" |
| 42 | </div> |
| 43 | ); |
| 44 | } |