wf-radio/frontend/src/components/Buttons/button.jsx

18 lines
537 B
React
Raw Normal View History

2025-05-12 16:56:14 +02:00
import styles from './button.module.css'
function Button({ children, onClick, className, variant = 'primary', ...rest}) {
// Construct dynamic class names using CSS Modules
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;