import { GitCommit } from "lucide-react"; import { relativeTime } from "@/shared/lib/relative-time"; import { useI18n } from "@/shared/i18n/I18nProvider"; import type { CommitInfo } from "../git-client"; function CommitRow({ commit }: { commit: CommitInfo }) { const { locale, t } = useI18n(); const firstLine = commit.message.split("\n")[0]; return (

{firstLine}

{t("repos.committed", { author: commit.author.name, time: relativeTime(commit.author.timestamp, locale), })}

{commit.oid.slice(0, 7)}
); } export function RepoCommitsSection({ commits, isLoading, }: { commits: CommitInfo[] | undefined; isLoading: boolean; }) { const { t } = useI18n(); if (isLoading) { return (

{t("repos.recentCommits")}

{["sk-1", "sk-2", "sk-3"].map((key) => (
))}
); } if (!commits || commits.length === 0) return null; return (

{t("repos.recentCommits")}

{commits.map((commit) => ( ))}
); }