blob: 70039a8a5c1f48eb706dc23f89216207314e27da (
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.link} ${styles[`link--${position}`]}`;
return isExternal ? (
<a className={classes} href={target}>
{children}
</a>
) : (
<Link href={target}>
<a className={classes}>{children}</a>
</Link>
);
};
export default ButtonLink;
|