Files
pse.dev/components/project/project-link.tsx
Kalidou Diagne f3fe727e5e General issues fix (#197)
* general issues fixes
2024-10-18 02:09:32 +01:00

32 lines
634 B
TypeScript

"use client"
import Image from "next/image"
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"
>
{icon}
</a>
)
}