"use client"; import { getWebhookVersionDocsUrl, getWebhookVersionLabel, WEBHOOK_VERSION_OPTIONS, } from "@calcom/features/webhooks/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button } from "@coss/ui/components/button"; import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "@coss/ui/components/select"; import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from "@coss/ui/components/tooltip"; import { ExternalLinkIcon } from "lucide-react"; import Link from "next/link"; import type { UseFormReturn } from "react-hook-form"; import type { WebhookFormValues } from "./WebhookForm"; const webhookVersionItems = WEBHOOK_VERSION_OPTIONS.map((option) => ({ value: option.value, label: option.label, })); export function WebhookVersionCTA({ formMethods }: { formMethods: UseFormReturn }) { const { t } = useLocale(); const version = formMethods.watch("version"); const selectedVersionItem = webhookVersionItems.find((item) => item.value === version) ?? webhookVersionItems[0]; return (
} /> {t("webhook_version")} }> } /> {t("webhook_version_docs", { version: getWebhookVersionLabel(version), })} ); }