diff --git a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/domains/DomainsList.tsx b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/domains/DomainsList.tsx index d29cba4..48050eb 100644 --- a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/domains/DomainsList.tsx +++ b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/domains/DomainsList.tsx @@ -1,9 +1,30 @@ "use client"; +import { ArrowRight, PlusIcon } from "lucide-react"; import { useFieldArray } from "react-hook-form"; import { z } from "zod"; -import { Form } from "~/components/ui/form"; -import { FormSubmit, SimpleFormField, useForm } from "~/hooks/forms"; +import { Button } from "~/components/ui/button"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "~/components/ui/form"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "~/components/ui/select"; +import { + FormSubmit, + FormUnsavedChangesIndicator, + SimpleFormField, + useForm, +} from "~/hooks/forms"; const formValidator = z.object({ domains: z.array( @@ -15,9 +36,9 @@ const formValidator = z.object({ { message: "Invalid domain name" }, ), - internalPort: z.number().int().min(1).max(65535), - https: z.boolean(), - forceSSL: z.boolean(), + internalPort: z.coerce.number().int().min(1).max(65535).default(8080), + https: z.boolean().default(true), + forceSSL: z.boolean().default(true), }), ), }); @@ -30,14 +51,14 @@ export default function DomainsList( }, ) { const form = useForm(formValidator, { - defaultValues: {}, - }); - const { fields, append, prepend, remove, swap, move, insert } = useFieldArray( - { - control: form.control, - name: "domains", + defaultValues: { + domains: [], }, - ); + }); + const domainsForm = useFieldArray({ + control: form.control, + name: "domains", + }); return (