2025-05-12 19:31:19 +02:00
|
|
|
import { h } from 'preact' // Necessary ?
|
2025-05-12 16:56:14 +02:00
|
|
|
import styles from './button.module.css'
|
|
|
|
|
|
|
|
function Button({ children, onClick, className, variant = 'primary', ...rest}) {
|
2025-05-12 19:31:19 +02:00
|
|
|
|
2025-05-12 16:56:14 +02:00
|
|
|
const buttonClasses = `${styles.button} ${styles[variant] || ''} ${className || ''}`
|
|
|
|
|
|
|
|
return (
|
|
|
|
<button
|
|
|
|
className={buttonClasses}
|
|
|
|
onClick= {onClick}
|
|
|
|
{...rest} // Allow passing other props like 'disabled', 'type', etc.
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</button>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Button;
|