import { Controller, useFormContext } from "react-hook-form"; import { useQuery } from "@tanstack/react-query"; import { z } from "zod"; import { FormControl, Input, Select, SelectItem } from "@app/components/v2"; import { gatewaysQueryKeys } from "@app/hooks/api"; import { slugSchema } from "@app/lib/schemas"; export const genericResourceFieldsSchema = z.object({ name: slugSchema({ min: 1, max: 64, field: "Name" }), gatewayId: z.string().min(1) }); export const GenericResourceFields = () => { const { data: gateways, isPending: isGatewaysLoading } = useQuery(gatewaysQueryKeys.list()); const { control } = useFormContext<{ name: string; gatewayId: string }>(); return ( <> ( )} /> ( )} /> ); };