-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
326 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/renderer/components/blocks/modals/ConfirmDeleteStagedItemModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react'; | ||
import { Button, Modal } from '@/components'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { useDeleteStagedItemMutation } from '@/api/cadt/v1/staging'; | ||
|
||
interface ConfirmDeleteModalProps { | ||
uuid: string; | ||
onClose: () => void; | ||
} | ||
|
||
const ConfirmDeleteStagedItemModal: React.FC<ConfirmDeleteModalProps> = ({ | ||
uuid, | ||
onClose, | ||
}: ConfirmDeleteModalProps) => { | ||
const [triggerDeleteStagedItem, { isLoading: stagedItemDeletionLoading }] = useDeleteStagedItemMutation(); | ||
const handleConfirm = async () => { | ||
await triggerDeleteStagedItem({ uuid }); | ||
onClose(); | ||
}; | ||
|
||
const handleClickClose = async () => { | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Modal show={true} onClose={onClose}> | ||
<Modal.Header> | ||
<FormattedMessage id="confirm-delete" /> | ||
</Modal.Header> | ||
<Modal.Body> | ||
<p> | ||
<FormattedMessage id="deleting-a-staged-item-is-a-permanent-action" />. | ||
</p> | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button color="gray" onClick={handleClickClose} disabled={stagedItemDeletionLoading}> | ||
<FormattedMessage id="cancel" /> | ||
</Button> | ||
<Button onClick={handleConfirm} isProcessing={stagedItemDeletionLoading} disabled={stagedItemDeletionLoading}> | ||
<FormattedMessage id="delete" /> | ||
</Button> | ||
</Modal.Footer> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export { ConfirmDeleteStagedItemModal }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.