diff --git a/packages/features/webhooks/components/WebhookListItem.tsx b/packages/features/webhooks/components/WebhookListItem.tsx index f332157262..3440865bb6 100644 --- a/packages/features/webhooks/components/WebhookListItem.tsx +++ b/packages/features/webhooks/components/WebhookListItem.tsx @@ -3,8 +3,20 @@ import type { WebhookTriggerEvents } from "@prisma/client"; import classNames from "@calcom/lib/classNames"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { Badge, Button, showToast, Switch, Tooltip } from "@calcom/ui"; -import { FiAlertCircle, FiTrash } from "@calcom/ui/components/icon"; +import { + Badge, + Button, + Dropdown, + DropdownItem, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, + DropdownMenuSeparator, + showToast, + Switch, + Tooltip, +} from "@calcom/ui"; +import { FiAlertCircle, FiEdit, FiMoreHorizontal, FiTrash } from "@calcom/ui/components/icon"; type WebhookProps = { id: string; @@ -39,21 +51,30 @@ export default function WebhookListItem(props: { }, }); + const onDeleteWebhook = () => { + // TODO: Confimation dialog before deleting + deleteWebhook.mutate({ id: webhook.id, eventTypeId: webhook.eventTypeId || undefined }); + }; + return (
-
-

{webhook.subscriberUrl}

+
+

{webhook.subscriberUrl}

-
+
{webhook.eventTriggers.map((trigger) => ( - + {t(`${trigger.toLowerCase()}`)} ))}
-
+
@@ -65,18 +86,35 @@ export default function WebhookListItem(props: { }) } /> -
);