| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import {
- Button,
- Dialog,
- DialogContent,
- DialogFooter,
- DialogHeader,
- DialogSection,
- DialogSectionSeparator,
- DialogTitle,
- } from 'ui'
- type DeleteMessageConfirmModalProps = {
- visible: boolean
- onConfirm: () => void
- onCancel: () => void
- }
- export const DeleteMessageConfirmModal = ({
- visible,
- onConfirm,
- onCancel,
- }: DeleteMessageConfirmModalProps) => {
- const onOpenChange = (open: boolean) => {
- if (!open) onCancel()
- }
- return (
- <Dialog open={visible} onOpenChange={onOpenChange}>
- <DialogContent size="small">
- <DialogHeader padding="small">
- <DialogTitle>Delete Message</DialogTitle>
- </DialogHeader>
- <DialogSectionSeparator />
- <DialogSection padding="small">
- <p className="text-sm text-foreground-light">
- Are you sure you want to delete this message and all subsequent messages? This action
- cannot be undone.
- </p>
- </DialogSection>
- <DialogFooter padding="small">
- <Button type="default" onClick={onCancel}>
- Cancel
- </Button>
- <Button type="danger" onClick={onConfirm}>
- Delete
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- )
- }
|