mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 10:23:54 +00:00
b7e758bf24
* chore: add typescript and dependencies * refactor: remove react imports * refactor: fix entrypoint * chore: upgrade chakra and deps * chore: configure eslint
31 lines
888 B
React
31 lines
888 B
React
import { IconButton } from '@chakra-ui/button';
|
|
import { Tooltip } from '@chakra-ui/tooltip';
|
|
import { IoPause } from '@react-icons/all-files/io5/IoPause';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { tooltipDelayMid } from '../../../ontimeConfig';
|
|
|
|
export default function PauseIconBtn(props) {
|
|
const { clickhandler, active, disabled, ...rest } = props;
|
|
return (
|
|
<Tooltip label='Pause timer' openDelay={tooltipDelayMid} shouldWrapChildren={disabled}>
|
|
<IconButton
|
|
icon={<IoPause size='24px' />}
|
|
colorScheme='orange'
|
|
_hover={!disabled && { bg: 'orange.400' }}
|
|
variant={active ? 'solid' : 'outline'}
|
|
onClick={clickhandler}
|
|
width={120}
|
|
disabled={disabled}
|
|
{...rest}
|
|
/>
|
|
</Tooltip>
|
|
);
|
|
}
|
|
|
|
PauseIconBtn.propTypes = {
|
|
clickhandler: PropTypes.func,
|
|
active: PropTypes.bool,
|
|
disabled: PropTypes.bool
|
|
}
|