diff options
Diffstat (limited to 'src/components/atoms/links/link.tsx')
| -rw-r--r-- | src/components/atoms/links/link.tsx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/components/atoms/links/link.tsx b/src/components/atoms/links/link.tsx index a61158f..87f11fc 100644 --- a/src/components/atoms/links/link.tsx +++ b/src/components/atoms/links/link.tsx @@ -2,11 +2,11 @@ import NextLink from 'next/link'; import { FC } from 'react'; import styles from './link.module.scss'; -type LinkProps = { +export type LinkProps = { /** - * Set additional classes to the link. + * Set additional classnames to the link. */ - classes?: string; + className?: string; /** * True if it is an external link. Default: false. */ @@ -28,24 +28,22 @@ type LinkProps = { */ const Link: FC<LinkProps> = ({ children, - classes, + className = '', href, lang, external = false, }) => { - const additionalClasses = classes || ''; - return external ? ( <a href={href} hrefLang={lang} - className={`${styles.link} ${styles['link--external']} ${additionalClasses}`} + className={`${styles.link} ${styles['link--external']} ${className}`} > {children} </a> ) : ( <NextLink href={href}> - <a className={`${styles.link} ${additionalClasses}`}>{children}</a> + <a className={`${styles.link} ${className}`}>{children}</a> </NextLink> ); }; |
