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