mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-17 21:24:11 +00:00
d81f5fcfe1
* chore: add new icons package and remove the old one * chore: update and consolidate imports * chore: missed import
28 lines
624 B
TypeScript
28 lines
624 B
TypeScript
import { IoTrash } from 'react-icons/io5';
|
|
import { IconButton } from '@chakra-ui/react';
|
|
|
|
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}
|
|
/>
|
|
);
|
|
}
|