"use client"; import { useBookerUrl } from "@calcom/features/bookings/hooks/useBookerUrl"; import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { RouterOutputs } from "@calcom/trpc/react"; import { Avatar } from "@calcom/ui/components/avatar"; import { EmptyScreen } from "@calcom/ui/components/empty-screen"; import { Frame, FrameDescription, FrameHeader, FramePanel, FrameTitle } from "@coss/ui/components/frame"; import { useRouter } from "next/navigation"; import React from "react"; import { CreateNewWebhookButton, WebhookListItem } from "../components"; type WebhooksByViewer = RouterOutputs["viewer"]["webhook"]["getByViewer"]; type Props = { data: WebhooksByViewer; }; const WebhooksView = ({ data }: Props) => { return (
); }; const WebhooksList = ({ webhooksByViewer }: { webhooksByViewer: WebhooksByViewer }) => { const { t } = useLocale(); const router = useRouter(); const { profiles, webhookGroups } = webhooksByViewer; const bookerUrl = useBookerUrl(); const hasTeams = profiles && profiles.length > 1; return (
{t("webhooks")} {t("add_webhook_description", { appName: APP_NAME })}
{webhookGroups.length ? ( <> {webhookGroups.map((group) => ( {hasTeams && (
{group.profile.name || ""}
)} {group.webhooks.map((webhook) => ( router.push(`${WEBAPP_URL}/settings/developer/webhooks/${webhook.id}`) } /> ))}
))} ) : ( } /> )} ); }; export default WebhooksView;