mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 13:44:12 +00:00
28 lines
643 B
TypeScript
28 lines
643 B
TypeScript
import { IconButton } from '@chakra-ui/react';
|
|
import { IoTrash } from '@react-icons/all-files/io5/IoTrash';
|
|
|
|
import { AppMode, useAppMode } from '../../../common/stores/appModeStore';
|
|
|
|
interface BlockDeleteProps {
|
|
onDelete: () => void;
|
|
}
|
|
|
|
export default function BlockDelete(props: BlockDeleteProps) {
|
|
const { onDelete } = props;
|
|
const mode = useAppMode((state) => state.mode);
|
|
|
|
const isRunMode = mode === AppMode.Run;
|
|
|
|
return (
|
|
<IconButton
|
|
aria-label='Delete'
|
|
size='sm'
|
|
icon={<IoTrash />}
|
|
variant='ontime-subtle'
|
|
color='#FA5656'
|
|
onClick={onDelete}
|
|
isDisabled={isRunMode}
|
|
/>
|
|
);
|
|
}
|