You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
495 B
TypeScript

// frontend/components/Button.tsx
import { Icon } from "./Icon";
import type { IconName } from "./icons/paths";
type Variant = "fill" | "lime" | "glass";
export function Button({
variant = "fill",
icon,
children,
className = "",
...rest
}: { variant?: Variant; icon?: IconName } & React.ButtonHTMLAttributes<HTMLButtonElement>) {
return (
<button className={`btn btn-${variant} ${className}`} {...rest}>
{icon && <Icon name={icon} />}
{children}
</button>
);
}