umami/components/common/Link.js

24 lines
680 B
JavaScript
Raw Normal View History

import React from 'react';
import classNames from 'classnames';
import NextLink from 'next/link';
2020-09-26 08:38:28 +02:00
import Icon from './Icon';
import styles from './Link.module.css';
2020-09-26 08:38:28 +02:00
export default function Link({ className, icon, children, size, iconRight, ...props }) {
return (
2020-08-05 07:45:05 +02:00
<NextLink {...props}>
2020-09-26 08:38:28 +02:00
<a
className={classNames(styles.link, className, {
[styles.large]: size === 'large',
[styles.small]: size === 'small',
[styles.xsmall]: size === 'xsmall',
[styles.iconRight]: iconRight,
})}
>
{icon && <Icon className={styles.icon} icon={icon} size={size} />}
{children}
</a>
</NextLink>
);
}