Support deleting a task from a schedule
This commit is contained in:
parent
5345a2a3e1
commit
78ed343a34
10 changed files with 172 additions and 8 deletions
|
@ -0,0 +1,26 @@
|
|||
import React from 'react';
|
||||
import Modal, { RequiredModalProps } from '@/components/elements/Modal';
|
||||
|
||||
type Props = RequiredModalProps & {
|
||||
onConfirmed: () => void;
|
||||
}
|
||||
|
||||
export default ({ onConfirmed, ...props }: Props) => (
|
||||
<Modal {...props}>
|
||||
<h2>Confirm task deletion</h2>
|
||||
<p className={'text-sm mt-4'}>
|
||||
Are you sure you want to delete this task? This action cannot be undone.
|
||||
</p>
|
||||
<div className={'flex items-center justify-end mt-8'}>
|
||||
<button className={'btn btn-secondary btn-sm'} onClick={() => props.onDismissed()}>
|
||||
Cancel
|
||||
</button>
|
||||
<button className={'btn btn-red btn-sm ml-4'} onClick={() => {
|
||||
props.onDismissed();
|
||||
onConfirmed();
|
||||
}}>
|
||||
Delete Task
|
||||
</button>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
Reference in a new issue