import { useGitLog } from '@/api/git' import { Loader2, GitCommit, AlertCircle, ArrowUp } from 'lucide-react' import { cn, formatShortRelativeTime } from '@/lib/utils' import { GIT_UI_COLORS } from '@/lib/git-status-styles' interface CommitsTabProps { repoId: number branch: string onSelectCommit?: (hash: string) => void } export function CommitsTab({ repoId, branch, onSelectCommit }: CommitsTabProps) { const { data, isLoading, error } = useGitLog(repoId, 50, branch) if (isLoading) { return (
) } if (error) { return (

Failed to load commits

{error.message}

) } if (!data?.commits || data.commits.length === 0) { return (

No commits found

) } return (
{data.commits.map((commit) => ( ))}
) }