From 3651e493d2dca0c4a32a60b0b8585d19ff801dff Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Thu, 13 Feb 2025 22:28:48 +0700 Subject: [PATCH] feat: add Harvest Details form and integrate into setup page --- frontend/app/setup/harvest-detail-form.tsx | 230 +++++++++++++++++++++ frontend/app/setup/page.tsx | 4 + 2 files changed, 234 insertions(+) create mode 100644 frontend/app/setup/harvest-detail-form.tsx diff --git a/frontend/app/setup/harvest-detail-form.tsx b/frontend/app/setup/harvest-detail-form.tsx new file mode 100644 index 0000000..38e2124 --- /dev/null +++ b/frontend/app/setup/harvest-detail-form.tsx @@ -0,0 +1,230 @@ +"use client"; + +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { harvestDetailsFormSchema } from "@/schemas/application.schema"; +import { useForm } from "react-hook-form"; +import { z } from "zod"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { Input } from "@/components/ui/input"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; + +type harvestSchema = z.infer; + +export default function HarvestDetailsForm() { + const form = useForm({ + resolver: zodResolver(harvestDetailsFormSchema), + defaultValues: {}, + }); + return ( +
+ + ( + + + Days To Flower + + +
+
+ +
+
+
+ +
+ )} + /> + ( + + + Days To Maturity + + +
+
+ +
+
+
+ +
+ )} + /> + ( + + + Harvest Window + + +
+
+ +
+
+
+ +
+ )} + /> + ( + + + Estimated Loss Rate + + +
+
+ +
+
+
+ +
+ )} + /> + ( + + Harvest Units + + + + + + )} + /> + ( + + + Estimated Revenue + + +
+
+ +
+
+
+ +
+ )} + /> + ( + + + Expected Yield Per100ft + + +
+
+ +
+
+
+ +
+ )} + /> + ( + + + Expected Yield Per Acre + + +
+
+ +
+
+
+ +
+ )} + /> + + + ); +} diff --git a/frontend/app/setup/page.tsx b/frontend/app/setup/page.tsx index 13457a1..d7afe64 100644 --- a/frontend/app/setup/page.tsx +++ b/frontend/app/setup/page.tsx @@ -1,4 +1,5 @@ import PlantingDetailsForm from "./planting-detail-form"; +import HarvestDetailsForm from "./harvest-detail-form"; import { Separator } from "@/components/ui/separator"; export default function SetupPage() { @@ -15,6 +16,9 @@ export default function SetupPage() {

Harvest Details

+
+ +
); }