import { PencilAltIcon, TrashIcon } from "@heroicons/react/outline"; import classNames from "@calcom/lib/classNames"; import { inferQueryOutput, trpc } from "@calcom/trpc/react"; import Button from "@calcom/ui/Button"; import { Dialog, DialogTrigger } from "@calcom/ui/Dialog"; import { Tooltip } from "@calcom/ui/Tooltip"; import { useLocale } from "@lib/hooks/useLocale"; import { ListItem } from "@components/List"; import ConfirmationDialogContent from "@components/dialog/ConfirmationDialogContent"; export type TWebhook = inferQueryOutput<"viewer.webhook.list">[number]; export default function WebhookListItem(props: { webhook: TWebhook; onEditWebhook: () => void }) { const { t } = useLocale(); const utils = trpc.useContext(); const deleteWebhook = trpc.useMutation("viewer.webhook.delete", { async onSuccess() { await utils.invalidateQueries(["viewer.webhook.list"]); }, }); return (
{props.webhook.subscriberUrl}
{props.webhook.eventTriggers.map((eventTrigger, ind) => ( {t(`${eventTrigger.toLowerCase()}`)} ))}
); }