2023-10-03 18:45:02 +02:00
|
|
|
import classNames from 'classnames';
|
2023-07-30 09:11:26 +02:00
|
|
|
import Link from 'next/link';
|
|
|
|
import { Icon, Icons, Text } from 'react-basics';
|
|
|
|
import styles from './LinkButton.module.css';
|
2023-10-03 18:45:02 +02:00
|
|
|
import { useLocale } from 'components/hooks';
|
|
|
|
|
|
|
|
export function LinkButton({ href, icon, className, children }) {
|
|
|
|
const { dir } = useLocale();
|
2023-07-30 09:11:26 +02:00
|
|
|
|
|
|
|
return (
|
2023-10-03 18:45:02 +02:00
|
|
|
<Link className={classNames(styles.button, className)} href={href}>
|
|
|
|
<Icon rotate={dir === 'rtl' ? 0 : 180}>{icon || <Icons.ArrowRight />}</Icon>
|
2023-07-30 09:11:26 +02:00
|
|
|
<Text>{children}</Text>
|
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
}
|
2023-08-21 11:06:09 +02:00
|
|
|
|
|
|
|
export default LinkButton;
|