mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-23 17:56:24 +02:00
31 lines
699 B
TypeScript
31 lines
699 B
TypeScript
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;
|