"use client"; import { Star, GitFork, ArrowUpRight } from "lucide-react"; import { ExternalLink } from "@/components/ExternalLink"; import { RepoStats } from "@/lib/types"; import { SiGithub } from "react-icons/si"; // GitHub linguist language colors const languageColors: Record = { TypeScript: "#3178c6", JavaScript: "#f1e05a", Python: "#3572A5", Rust: "#dea584", Go: "#00ADD8", Ruby: "#701516", Java: "#b07219", "C++": "#f34b7d", C: "#555555", "C#": "#178600", PHP: "#4F5D95", Swift: "#F05138", Kotlin: "#A97BFF", HTML: "#e34c26", CSS: "#663399", Shell: "#89e051", Lua: "#000080", Dart: "#00B4AB", Scala: "#c22d40", Elixir: "#6e4a7e", Haskell: "#5e5086", Vue: "#41b883", SCSS: "#c6538c", Dockerfile: "#384d54", Makefile: "#427819", }; function getLanguageColor(language: string | null): string { if (!language) return "#56ba8e"; // Site green fallback return languageColors[language] || "#56ba8e"; // Site green fallback } interface OpenSourceCardProps { name: string; description: string; repo: string; stats?: RepoStats; loading?: boolean; featured?: boolean; status?: "active" | "beta" | "deprecated" | "alpha"; liveUrl?: string; } export function OpenSourceCard({ name, description, repo, stats, loading, featured, status, liveUrl, }: OpenSourceCardProps) { const repoUrl = `https://github.com/${repo}`; return (

{name}

{status === "alpha" && ( Alpha )} {status === "beta" && ( Beta )} {status === "deprecated" && ( Deprecated )}
{liveUrl && ( )}

{description}

{/* Stats row */}
{loading ? ( Loading stats... ) : stats && !stats.error ? ( <> {stats.language && ( {stats.language} )} {stats.stars} {stats.forks > 0 && ( {stats.forks} )} ) : null}
); }