import Link from "next/link"; import { Card } from "@unlocalhosted/metalui"; import type { ReactNode } from "react"; import type { ForkParent, RepoRecord } from "@/lib/repos"; import { timeAgo } from "@/lib/format"; import { ClockIcon, HeartIcon, LockIcon, RepoIcon } from "./icons"; import { ForkedFrom, ForkLabel } from "./forks"; import { CardDescription, CardTitle } from "./metal"; import { RepoAvatar, VisibilityLabel } from "./ui"; export type RepoListItem = RepoRecord & { updatedAt: number; empty: boolean; parent: ForkParent | null; likes: number }; /** * Repositories as MetalUI cards: the title is the card's one link, so the whole plate goes to the * repository. `actions` adds controls to a card's footer (they sit above the link). */ export function RepoList({ repos, showOwner = true, actions }: { repos: RepoListItem[]; showOwner?: boolean; actions?: (repo: RepoListItem) => ReactNode }) { return (