"use client"; import { GitLogResponse, CommitInfo } from "@/types/git"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Skeleton } from "@/components/ui/skeleton"; import { ScrollArea } from "@/components/ui/scroll-area"; import { cn } from "@/lib/utils"; import { GitCommit, User, Calendar } from "lucide-react"; import { formatDistanceToNow } from "date-fns"; import { HelpTip } from "@/components/ui/help-tip"; interface GitLogPanelProps { log: GitLogResponse | undefined; isLoading: boolean; onSelectCommit?: (commit: CommitInfo) => void; selectedHash?: string; } export function GitLogPanel({ log, isLoading, onSelectCommit, selectedHash, }: GitLogPanelProps) { if (isLoading) { return ( {Array.from({ length: 6 }).map((_, i) => (
))}
); } if (!log || log.commits.length === 0) { return (

No commits found

); } return ( Commit History {log.branch}
{log.commits.map((commit, index) => ( ))}
); }