"use client"; import Link from "next/link"; import { formatDistanceToNow } from "date-fns"; import { Lock, Globe, Star } from "lucide-react"; type Repository = { id: string; name: string; description: string | null; visibility: "public" | "private"; updatedAt: Date; starCount?: number; }; export function RepoList({ repos, username, }: { repos: Repository[]; username: string; }) { return (
{repos.map((repo) => (
{repo.name} {repo.visibility === "private" ? ( <> Private ) : ( <> Public )}
{repo.description && (

{repo.description}

)}
{typeof repo.starCount === "number" && repo.starCount > 0 && (
{repo.starCount}
)}

{formatDistanceToNow(new Date(repo.updatedAt), { addSuffix: true })}

))}
); }