import type { Dictionary } from "@/lib/i18n/get-dictionary"; import type { Locale } from "@/lib/i18n/locales"; import type { GiteaRepo } from "@/lib/gitea"; import { SectionHeading } from "@/components/section-heading"; const LANGUAGE_COLORS: Partial> = { "C#": "#178600", TypeScript: "#3178c6", JavaScript: "#f1e05a", Python: "#3572a5", Rust: "#dea584", Go: "#00add8", }; export function ProjectsSection({ repos, dict, locale, }: { repos: GiteaRepo[]; dict: Dictionary["projects"]; locale: Locale; }) { const dateFormat = new Intl.DateTimeFormat(locale, { dateStyle: "medium" }); return (
{repos.length === 0 ? (

{dict.empty}

) : (
{repos.map((repo) => (

{repo.fullName}

{repo.name}

{repo.description ?? dict.noDescription}

{repo.language ? ( {repo.language} ) : null} ★ {repo.stars} {dict.stars} ⑂ {repo.forks} {dict.forks} {dict.updated}: {dateFormat.format(new Date(repo.updatedAt))}
))}
)}
); }