import { useRouter } from "next/router"; import { Suspense } from "react"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { Icon } from "@calcom/ui"; import { ButtonGroup, EmptyScreen, SkeletonText } from "@calcom/ui/v2"; import { Button } from "@calcom/ui/v2/core/Button"; import Meta from "@calcom/ui/v2/core/Meta"; import { getLayout } from "@calcom/ui/v2/core/layouts/SettingsLayout"; import { WebhookListItem, WebhookListSkeleton } from "../components"; const WebhooksView = () => { return ( <>
}>
); }; const NewWebhookButton = () => { const { t, isLocaleReady } = useLocale(); return ( ); }; const WebhooksList = () => { const { t } = useLocale(); const router = useRouter(); const { data: webhooks } = trpc.useQuery(["viewer.webhook.list"], { suspense: true, enabled: router.isReady, }); return ( <> {webhooks?.length ? ( <>
{webhooks.map((webhook, index) => ( router.push(`${WEBAPP_URL}/v2/settings/developer/webhooks/${webhook.id} `) } /> ))}
) : ( } /> )} ); }; WebhooksView.getLayout = getLayout; export default WebhooksView;