Abhijith Vijayan [FLUXON] 72fa5db993 feat: use css modules
2026-01-03 19:38:23 +05:30

39 lines
875 B
TypeScript

import * as React from "react";
import type { FC, ReactNode, ButtonHTMLAttributes } from "react";
import styles from "./Button.module.scss";
type ButtonVariant = "primary" | "secondary" | "settings" | "github" | "support";
type ButtonSize = "small" | "medium" | "large";
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: ButtonVariant;
size?: ButtonSize;
fullWidth?: boolean;
children: ReactNode;
}
export const Button: FC<ButtonProps> = ({
variant = "primary",
size = "medium",
fullWidth = false,
children,
className,
...props
}) => {
const classNames = [
styles.button,
styles[variant],
styles[size],
fullWidth && styles.fullWidth,
className,
]
.filter(Boolean)
.join(" ");
return (
<button type="button" className={classNames} {...props}>
{children}
</button>
);
};