File size: 699 Bytes
339aa1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
import classNames from 'classnames';
import Link from 'next/link';
import { useLocale } from 'components/hooks';
import styles from './LinkButton.module.css';
import { ReactNode } from 'react';

export interface LinkButtonProps {
  href: string;
  className?: string;
  variant?: string;
  scroll?: boolean;
  children?: ReactNode;
}

export function LinkButton({ href, className, variant, scroll = true, children }: LinkButtonProps) {
  const { dir } = useLocale();

  return (
    <Link
      className={classNames(styles.button, className, { [styles[variant]]: true })}
      href={href}
      dir={dir}
      scroll={scroll}
    >
      {children}
    </Link>
  );
}

export default LinkButton;