You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

  1. import React, { FC } from "react";
  2. export interface SocialsShareProps {
  3. className?: string;
  4. itemClass?: string;
  5. }
  6. export interface SocialType {
  7. name: string;
  8. icon: string;
  9. href: string;
  10. }
  11. const socials: SocialType[] = [
  12. { name: "Facebook", icon: "lab la-facebook-f", href: "#" },
  13. { name: "Twitter", icon: "lab la-twitter", href: "#" },
  14. { name: "Linkedin", icon: "lab la-linkedin-in", href: "#" },
  15. { name: "Instagram", icon: "lab la-instagram", href: "#" },
  16. ];
  17. const SocialsShare: FC<SocialsShareProps> = ({
  18. className = "grid gap-[6px]",
  19. itemClass = "w-7 h-7 text-base hover:bg-neutral-100",
  20. }) => {
  21. const renderItem = (item: SocialType, index: number) => {
  22. return (
  23. <a
  24. key={index}
  25. href={item.href}
  26. className={`rounded-full leading-none flex items-center justify-center bg-white text-neutral-6000 ${itemClass}`}
  27. title={`Share on ${item.name}`}
  28. >
  29. <i className={item.icon}></i>
  30. </a>
  31. );
  32. };
  33. return (
  34. <div className={`nc-SocialsShare ${className}`} data-nc-id="SocialsShare">
  35. {socials.map(renderItem)}
  36. </div>
  37. );
  38. };
  39. export default SocialsShare;