All files / src/components/ui/links SocialLink.tsx

31.42% Statements 11/35
100% Branches 0/0
0% Functions 0/1
31.42% Lines 11/35

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361x 1x 1x 1x 1x 1x 1x 1x 1x                                                 1x 1x  
import React from "react";
import { FacebookIcon, InstagramIcon, LinkedinIcon, TwitterIcon } from "@/components";
 
type SocialLinkProps = {
  type: "Facebook" | "Twitter" | "Instagram" | "Linkedin";
 
};
 
const SocialLink: React.FC<SocialLinkProps> = ({ type }) => {

  const Icon = {
    Facebook: FacebookIcon,
    Twitter: TwitterIcon,
    Instagram: InstagramIcon,
    Linkedin: LinkedinIcon}[type];

  const href = {
    Facebook: "#",
    Twitter: "#",
    Instagram: "#",
    Linkedin: "#"}[type]

  return (
    <a
      href={href}
      aria-label={type}
      className="flex ease-out duration-200 hover:text-blue"
    >  <Icon />

    </a>

  );
};
 
export default SocialLink;