portfolio/components/SocialLink.tsx

19 lines
567 B
TypeScript
Raw Normal View History

2023-01-21 22:59:27 +00:00
import Link from 'next/link'
import {ElementType} from 'react'
2023-01-25 22:41:21 +00:00
import clsx from 'clsx'
2023-01-21 22:59:27 +00:00
type SocialLink = {
href: string
2023-01-22 00:12:13 +00:00
ariaLabel: string
2023-01-21 22:59:27 +00:00
icon: ElementType
2023-01-25 22:41:21 +00:00
className?: string
2023-01-21 22:59:27 +00:00
}
2023-01-25 22:41:21 +00:00
export function SocialLink({icon: Icon, href, ariaLabel, className}: SocialLink) {
2023-01-21 22:59:27 +00:00
return (
2023-01-26 22:00:08 +00:00
<Link className="group -m-1 p-1" href={href} aria-label={ariaLabel}>
2023-01-21 22:59:27 +00:00
<Icon
2023-01-26 22:00:08 +00:00
className={clsx(className, "w-6 h-6 fill-zinc-500 transition group-hover:fill-zinc-600 dark:fill-zinc-400 dark:group-hover:fill-zinc-300")}/>
2023-01-21 22:59:27 +00:00
</Link>
)
}