|
1 | 1 | "use client"; |
2 | 2 |
|
3 | 3 | import { useSession } from "next-auth/react"; |
| 4 | +import Link from "next/link"; |
4 | 5 | import { useRouter } from "next/navigation"; |
5 | 6 |
|
6 | 7 | import SettingsHeaderWithBackButton from "@calcom/features/settings/appDir/SettingsHeaderWithBackButton"; |
7 | 8 | import { APP_NAME } from "@calcom/lib/constants"; |
8 | 9 | import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; |
9 | 10 | import { useLocale } from "@calcom/lib/hooks/useLocale"; |
10 | | -import { WEBHOOK_VERSION_OPTIONS, getWebhookVersionLabel } from "../lib/constants"; |
| 11 | +import { WEBHOOK_VERSION_OPTIONS, getWebhookVersionLabel, getWebhookVersionDocsUrl } from "../lib/constants"; |
11 | 12 | import { trpc } from "@calcom/trpc/react"; |
12 | 13 | import type { RouterOutputs } from "@calcom/trpc/react"; |
13 | 14 | import { Select } from "@calcom/ui/components/form"; |
| 15 | +import { Icon } from "@calcom/ui/components/icon"; |
14 | 16 | import { showToast } from "@calcom/ui/components/toast"; |
15 | 17 | import { Tooltip } from "@calcom/ui/components/tooltip"; |
16 | 18 | import { revalidateWebhooksList } from "@calcom/web/app/(use-page-wrapper)/settings/(settings-layout)/developer/webhooks/(with-loader)/actions"; |
@@ -90,23 +92,36 @@ export const NewWebhookView = ({ webhooks, installedApps }: Props) => { |
90 | 92 | description={t("add_webhook_description", { appName: APP_NAME })} |
91 | 93 | borderInShellHeader={true} |
92 | 94 | CTA={ |
93 | | - <Tooltip content={t("webhook_version")}> |
94 | | - <div> |
95 | | - <Select |
96 | | - className="min-w-36" |
97 | | - options={WEBHOOK_VERSION_OPTIONS} |
98 | | - value={{ |
99 | | - value: formMethods.watch("version"), |
100 | | - label: getWebhookVersionLabel(formMethods.watch("version")), |
101 | | - }} |
102 | | - onChange={(option) => { |
103 | | - if (option) { |
104 | | - formMethods.setValue("version", option.value, { shouldDirty: true }); |
105 | | - } |
106 | | - }} |
107 | | - /> |
108 | | - </div> |
109 | | - </Tooltip> |
| 95 | + <div className="flex items-center gap-2"> |
| 96 | + <Tooltip content={t("webhook_version")}> |
| 97 | + <div> |
| 98 | + <Select |
| 99 | + className="min-w-36" |
| 100 | + options={WEBHOOK_VERSION_OPTIONS} |
| 101 | + value={{ |
| 102 | + value: formMethods.watch("version"), |
| 103 | + label: getWebhookVersionLabel(formMethods.watch("version")), |
| 104 | + }} |
| 105 | + onChange={(option) => { |
| 106 | + if (option) { |
| 107 | + formMethods.setValue("version", option.value, { shouldDirty: true }); |
| 108 | + } |
| 109 | + }} |
| 110 | + /> |
| 111 | + </div> |
| 112 | + </Tooltip> |
| 113 | + <Tooltip |
| 114 | + content={t("webhook_version_docs", { |
| 115 | + version: getWebhookVersionLabel(formMethods.watch("version")), |
| 116 | + })}> |
| 117 | + <Link |
| 118 | + href={getWebhookVersionDocsUrl(formMethods.watch("version"))} |
| 119 | + target="_blank" |
| 120 | + className="text-subtle hover:text-emphasis flex items-center"> |
| 121 | + <Icon name="external-link" className="h-4 w-4" /> |
| 122 | + </Link> |
| 123 | + </Tooltip> |
| 124 | + </div> |
110 | 125 | }> |
111 | 126 | {children} |
112 | 127 | </SettingsHeaderWithBackButton> |
|
0 commit comments