mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 03:43:50 +00:00
67ddcd8c68
* feat/table add react-table * feat/table add protected table route * feat/table upgrade dependencies * feat/table support parsing of new properties Co-authored-by: DeepSource Bot <bot@deepsource.io>
24 lines
735 B
React
24 lines
735 B
React
import React from 'react';
|
|
import { IconButton } from '@chakra-ui/button';
|
|
import { IoSunny } from '@react-icons/all-files/io5/IoSunny';
|
|
import { Tooltip } from '@chakra-ui/tooltip';
|
|
|
|
export default function VisibleIconBtn(props) {
|
|
const { actionHandler, active, size, ...rest } = props;
|
|
return (
|
|
<Tooltip label={active ? 'Make invisible' : 'Make visible'} openDelay={500}>
|
|
<IconButton
|
|
size={size || 'xs'}
|
|
icon={<IoSunny size='18px' />}
|
|
colorScheme='blue'
|
|
variant={active ? 'solid' : 'outline'}
|
|
onClick={() =>
|
|
actionHandler('update', { field: 'isPublic', value: !active })
|
|
}
|
|
_focus={{ boxShadow: 'none' }}
|
|
{...rest}
|
|
/>
|
|
</Tooltip>
|
|
);
|
|
}
|