"use client"; import { useRouter } from "next/navigation"; import { useBookerUrl } from "@calcom/features/bookings/hooks/useBookerUrl"; import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; import { APP_NAME, WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { RouterOutputs } from "@calcom/trpc/react"; import classNames from "@calcom/ui/classNames"; import { Avatar } from "@calcom/ui/components/avatar"; import { EmptyScreen } from "@calcom/ui/components/empty-screen"; import { WebhookListItem, CreateNewWebhookButton } 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 ( 0 ? : null} borderInShellHeader={false}> {webhookGroups.length ? (
{webhookGroups.map((group) => (
{hasTeams && (
{group.profile.name || ""}
)}
{group.webhooks.map((webhook, index) => ( router.push(`${WEBAPP_URL}/settings/developer/webhooks/${webhook.id}`) } /> ))}
))}
) : ( } border={true} /> )}
); }; export default WebhooksView;