diff --git a/packages/frontend/src/components/projects/Dialog/DeleteWebhookDialog.tsx b/packages/frontend/src/components/projects/Dialog/DeleteWebhookDialog.tsx new file mode 100644 index 00000000..c2c82c16 --- /dev/null +++ b/packages/frontend/src/components/projects/Dialog/DeleteWebhookDialog.tsx @@ -0,0 +1,36 @@ +import ConfirmDialog, { + ConfirmDialogProps, +} from 'components/shared/ConfirmDialog'; +import React from 'react'; + +interface DeleteWebhookDialogProps extends ConfirmDialogProps { + webhookUrl: string; +} + +export const DeleteWebhookDialog = ({ + webhookUrl, + open, + handleCancel, + handleConfirm, + ...props +}: DeleteWebhookDialogProps) => { + return ( + +

+ Are you sure you want to delete{' '} + + {webhookUrl} + + ? +

+
+ ); +}; diff --git a/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx b/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx index 0d03e46e..80aaf4f1 100644 --- a/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx +++ b/packages/frontend/src/components/projects/project/settings/WebhookCard.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; import toast from 'react-hot-toast'; -import { Button, Typography } from '@material-tailwind/react'; +import { Button } from '@material-tailwind/react'; -import ConfirmDialog from '../../../shared/ConfirmDialog'; +import { DeleteWebhookDialog } from 'components/projects/Dialog/DeleteWebhookDialog'; interface WebhookCardProps { webhookUrl: string; @@ -15,7 +15,6 @@ const WebhookCard = ({ webhookUrl, onDelete }: WebhookCardProps) => { return (
{webhookUrl} -
- - setDeleteDialogOpen((preVal) => !preVal)} + setDeleteDialogOpen((preVal) => !preVal)} open={deleteDialogOpen} - confirmButtonTitle="Yes, Confirm delete" handleConfirm={() => { setDeleteDialogOpen((preVal) => !preVal); onDelete(); }} - color="red" - > - - Are you sure you want to delete the variable{' '} - {webhookUrl}? - - + webhookUrl={webhookUrl} + />
); };