import classNames from 'classnames'; import React, { FC, ReactNode, RefObject } from 'react'; import LinkedinSVG from '../../assets/icons/social/linkedin.svg'; import MailSVG from '../../assets/icons/social/mail.svg'; import { getModifier } from '../../helpers/getModifier'; import css from './index.module.css'; export interface LinkProps { to?: string; tabIndex?: number; className?: string; variant?: | 'normal' | 'primary' | 'secondary' | 'tertiary' | 'navigation' | 'navigationBlue'; target?: '_blank' | '_self' | '_parent' | '_top'; ref?: RefObject; onClick?: (e) => void; ariaLabel?: string; isExternal?: boolean; onKeyDown?: (e) => void; children?: ReactNode; title?: string; icon?: 'email' | 'linkedin'; rel?: string; } const Link: FC = ({ children, to, className, variant, target, ref, onClick, ariaLabel, isExternal = false, onKeyDown, tabIndex, title, icon, rel = '', }) => { const linkClassNames = classNames(css.link, { [`${className}`]: className, [`${css[`link${getModifier(variant)}`]}`]: variant, }); return ( {icon && ( {icon === 'email' && } {icon === 'linkedin' && } )} {children} ); }; export default Link;