useDeleteModal

A hook that provides a callback to launch a modal for deleting a resource.

Example
const DeletePodButton = ({ pod }) => {
  const { t } = useTranslation();
  const launchDeleteModal = useDeleteModal<PodKind>(pod);
  return <button onClick={launchDeleteModal}>{t('Delete Pod')}</button>
}
Parameter Name Description

resource

The resource to delete.

redirectTo

(optional) A location to redirect to after deleting the resource.

message

(optional) A message to display in the modal.

btnText

(optional) The text to display on the delete button.

deleteAllResources

(optional) A function to delete all resources of the same kind.

Returns A function which launches a modal for deleting a resource.