Files
pse.dev/components/project/project-link.tsx
2024-11-06 01:59:28 +01:00

31 lines
628 B
TypeScript

"use client"
import { ProjectLinkWebsite } from "@/lib/types"
import { ProjectLinkIconMap } from "./project-links"
interface ProjectLinkProps {
url: string
website: ProjectLinkWebsite
}
export function ProjectLink({ website, url }: ProjectLinkProps) {
const icon = ProjectLinkIconMap?.[website as ProjectLinkWebsite]
if (!icon) return null
return (
<a
href={url}
onClick={(event) => {
// prevent box link to redirect to project page
event?.stopPropagation()
}}
target="_blank"
rel="noopener noreferrer"
className="text-lg"
>
{icon}
</a>
)
}