mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 09:53:48 +00:00
edac1d7f75
* refactor: rename timer endpoint * refactor: typescript * refactor: rename eventData and viewSettings * refactor: message manager uses event store
31 lines
838 B
TypeScript
31 lines
838 B
TypeScript
import { ForwardedRef, forwardRef, PropsWithChildren } from 'react';
|
|
import { Playback } from 'ontime-types';
|
|
|
|
import style from './TapButton.module.scss';
|
|
|
|
interface TapButtonProps {
|
|
disabled?: boolean;
|
|
square?: boolean;
|
|
onClick: () => void;
|
|
theme?: Playback | 'neutral';
|
|
active?: boolean;
|
|
}
|
|
|
|
const TapButton = forwardRef((props: PropsWithChildren<TapButtonProps>, ref: ForwardedRef<HTMLButtonElement> ) => {
|
|
const { children, disabled, onClick, theme = 'neutral', square, active } = props;
|
|
return (
|
|
<button
|
|
className={`${style.tapButton} ${style[theme]} ${square ? style.square : ''} ${active ? style.active : ''}`}
|
|
disabled={disabled}
|
|
type='button'
|
|
onClick={onClick}
|
|
ref={ref}
|
|
>
|
|
{children}
|
|
</button>
|
|
);
|
|
});
|
|
|
|
TapButton.displayName = "TabButton";
|
|
export default TapButton;
|