import { useState } from 'react';
import type { Project } from '../types/project';
interface ProjectCardProps {
project: Project;
}
export default function ProjectCard({ project }: ProjectCardProps) {
const [showWarning, setShowWarning] = useState(false);
const [showInfrastructureInfo, setShowInfrastructureInfo] = useState(false);
const getLinkIcon = (kind: string, url?: string) => {
// Special case: Show Bluesky icon for social links on bsky.app
if (kind === 'social' && url?.includes('bsky.app')) {
return (
);
}
// Special case: Show Mastodon icon for social links on Mastodon instances
if (kind === 'social' && (url?.includes('mastodon.social') || url?.includes('tech.lgbt') || url?.includes('social.funkwhale.audio'))) {
return (
);
}
switch (kind) {
case 'homepage':
return (
);
case 'repo':
// Use GitHub icon only for GitHub URLs, otherwise use code icon
if (url?.includes('github.com')) {
return (
);
} else {
return (
);
}
case 'docs':
return (
);
case 'demo':
return (
);
case 'spec':
return (
);
case 'social':
return (
);
default:
return (
);
}
};
const homepageLink = project.links?.find(link => link.kind === 'homepage')?.url;
return (
{project.domain || `github.com/${project.owner}`}
)}{project.description}