diff --git a/apps/dashboard/src/@/api/insight/webhooks.ts b/apps/dashboard/src/@/api/insight/webhooks.ts index d694c7f4b6f..9a803425cd3 100644 --- a/apps/dashboard/src/@/api/insight/webhooks.ts +++ b/apps/dashboard/src/@/api/insight/webhooks.ts @@ -67,8 +67,7 @@ interface TestWebhookResponse { error?: string; } -// biome-ignore lint/correctness/noUnusedVariables: will be used in the next PR -async function createWebhook( +export async function createWebhook( payload: CreateWebhookPayload, clientId: string, ): Promise { diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/BasicInfoStep.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/BasicInfoStep.tsx new file mode 100644 index 00000000000..4d1a6de38e8 --- /dev/null +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/BasicInfoStep.tsx @@ -0,0 +1,189 @@ +"use client"; + +import { Button } from "@/components/ui/button"; +import { + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; +import { cn } from "@/lib/utils"; +import type { UseFormReturn } from "react-hook-form"; +import type { WebhookFormValues } from "../utils/webhookTypes"; + +interface BasicInfoStepProps { + form: UseFormReturn; + goToNextStep: () => void; + isLoading: boolean; +} + +export default function BasicInfoStep({ + form, + goToNextStep, + isLoading, +}: BasicInfoStepProps) { + return ( + <> +
+

Step 1: Basic Information

+

+ Provide webhook details and select filter type +

+
+ + ( + + + Name * + + + + + + + )} + /> + + ( + + + Webhook URL * + + + + + + + )} + /> + + ( + + + Filter Type * + + + { + if (value !== "event" && value !== "transaction") { + return; + } + field.onChange(value); + // Ensure the form state is updated immediately + form.setValue("filterType", value, { + shouldValidate: true, + shouldDirty: true, + }); + }} + value={field.value || undefined} + className="grid grid-cols-1 gap-4 md:grid-cols-2" + > +
+