Files
ontime/apps/client/src/features/control/playback/tap-button/TapButton.tsx
T
Carlos Valente 40d389acc9 v2 beta 4 (#361)
* ux: rename end action

* chore: update demo db

* style: tweaks on extracted rundown

* chore: prevent console logs in production code

* feat: go mode

* style: remove window size limits

* style: rename delete action

* style: small tweaks on icons

* fix: style override on params

* chore: update test db

* refactor: small code quality improvements

* refactor: prevent circular imports
2023-04-25 22:35:14 +02:00

32 lines
987 B
TypeScript

import { ForwardedRef, forwardRef, PropsWithChildren } from 'react';
import { Playback } from 'ontime-types';
import { cx } from '../../../../common/utils/styleUtils';
import style from './TapButton.module.scss';
interface TapButtonProps {
disabled?: boolean;
aspect?: 'normal' | 'square' | 'fill';
square?: boolean;
free?: boolean;
onClick: () => void;
theme?: Playback | 'neutral';
active?: boolean;
className?: string;
}
const TapButton = forwardRef((props: PropsWithChildren<TapButtonProps>, ref: ForwardedRef<HTMLButtonElement>) => {
const { children, disabled, onClick, theme = 'neutral', aspect = 'normal', active, className } = props;
const classes = cx([style.tapButton, className, style[theme], style[aspect], active ? style.active : null]);
return (
<button className={classes} disabled={disabled} type='button' onClick={onClick} ref={ref}>
{children}
</button>
);
});
TapButton.displayName = 'TabButton';
export default TapButton;