mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 11:23:50 +00:00
ac4257ece9
fix: parsing of custom fields for blocks refactor: extract cuesheet settings refactor: cuesheet actions refactor: improve cuesheet performance on resizing
31 lines
859 B
TypeScript
31 lines
859 B
TypeScript
import { ButtonHTMLAttributes, forwardRef } from 'react';
|
|
|
|
import { cx } from '../../utils/styleUtils';
|
|
|
|
import style from './Button.module.scss';
|
|
|
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
variant?: 'primary' | 'subtle' | 'subtle-white' | 'destructive' | 'subtle-destructive' | 'ghosted';
|
|
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
fluid?: boolean;
|
|
}
|
|
|
|
const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
|
|
const { className, children, variant = 'subtle', size = 'medium', fluid, ...buttonProps } = props;
|
|
|
|
return (
|
|
<button
|
|
ref={ref}
|
|
className={cx([style.baseButton, style[variant], style[size], fluid && style.fluid, className])}
|
|
type='button'
|
|
{...buttonProps}
|
|
>
|
|
{children}
|
|
</button>
|
|
);
|
|
});
|
|
|
|
Button.displayName = 'Button';
|
|
|
|
export default Button;
|