refactor: create reusable buttons

This commit is contained in:
Carlos Valente
2025-06-03 21:44:15 +02:00
committed by Carlos Valente
parent 44d5859844
commit 97e3e8f435
4 changed files with 125 additions and 8 deletions
@@ -0,0 +1,19 @@
import { ButtonHTMLAttributes } from 'react';
import { cx } from '../../utils/styleUtils';
import style from './Button.module.scss';
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: 'subtle' | 'primary';
}
export default function Button(props: ButtonProps) {
const { className, children, variant = 'subtle', ...buttonProps } = props;
return (
<button className={cx([style.baseButton, style[variant], className])} type='button' {...buttonProps}>
{children}
</button>
);
}