import { Component, For, Show } from "solid-js"; import { Typewriter } from "./Typewriter"; import { SkeletonText, SkeletonBox } from "./SkeletonLoader"; interface Commit { sha: string; message: string; author: string; date: string; repo: string; url: string; } export const RecentCommits: Component<{ commits: Commit[] | undefined; title: string; loading?: boolean; }> = (props) => { const formatDate = (dateString: string) => { const date = new Date(dateString); const now = new Date(); const diffMs = now.getTime() - date.getTime(); const diffMins = Math.floor(diffMs / 60000); const diffHours = Math.floor(diffMs / 3600000); const diffDays = Math.floor(diffMs / 86400000); if (diffMins < 60) { return `${diffMins}m ago`; } else if (diffHours < 24) { return `${diffHours}h ago`; } else if (diffDays < 7) { return `${diffDays}d ago`; } else { return date.toLocaleDateString("en-US", { month: "short", day: "numeric" }); } }; return (