blob: 179c6862d85c9848e287b5d75e1c10dc8a109dd1 (
plain)
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
|
import { ButtonPosition } from '@ts/types/app';
import Link from 'next/link';
import { ReactNode } from 'react';
import styles from '../Buttons.module.scss';
const ButtonLink = ({
children,
target,
position = 'left',
isExternal = false,
}: {
children: ReactNode;
target: string;
position?: ButtonPosition;
isExternal?: boolean;
}) => {
const classes = `${styles.btn} ${styles[position]} ${styles.tertiary}`;
return isExternal ? (
<a className={classes} href={target}>
{children}
</a>
) : (
<Link href={target}>
<a className={classes}>{children}</a>
</Link>
);
};
export default ButtonLink;
|