Files
Wisecolt-CI/frontend/src/components/RepoIcon.tsx
2025-11-27 13:04:34 +03:00

14 lines
815 B
TypeScript

import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faGithub } from "@fortawesome/free-brands-svg-icons";
import { faCodeBranch } from "@fortawesome/free-solid-svg-icons";
import giteaLogo from "../assets/gitea.png";
import gitlabLogo from "../assets/gitlab.png";
export function RepoIcon({ repoUrl }: { repoUrl: string }) {
const lower = repoUrl.toLowerCase();
if (lower.includes("github.com")) return <FontAwesomeIcon icon={faGithub} className="h-5 w-5 text-foreground" />;
if (lower.includes("gitlab")) return <img src={gitlabLogo} alt="GitLab" className="h-5 w-5 object-contain" />;
if (lower.includes("gitea")) return <img src={giteaLogo} alt="Gitea" className="h-5 w-5 object-contain" />;
return <FontAwesomeIcon icon={faCodeBranch} className="h-5 w-5 text-foreground" />;
}