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 0000000..c2c82c1 --- /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 0d03e46..80aaf4f 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} + />
); };