From cb16141eb62a86a7f459412d2d0078ddc4cc03db Mon Sep 17 00:00:00 2001 From: "mihailo.vojinovic" Date: Wed, 11 Feb 2026 15:36:32 +0100 Subject: Add a submit handler for bebugging --- src/components/invoice-generator.tsx | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/invoice-generator.tsx b/src/components/invoice-generator.tsx index d1552c1..32f2d53 100644 --- a/src/components/invoice-generator.tsx +++ b/src/components/invoice-generator.tsx @@ -2,7 +2,12 @@ import { Invoice, InvoiceSchema } from "@/models/invoice"; import { zodResolver } from "@hookform/resolvers/zod"; -import { useFieldArray, useForm, useWatch } from "react-hook-form"; +import { + useFieldArray, + useForm, + useWatch, + SubmitHandler, +} from "react-hook-form"; import { Input } from "./ui/input"; import React from "react"; import { cn } from "@/utils/cn"; @@ -40,8 +45,15 @@ export const InvoiceGenerator = () => { const lineItems = useWatch({ control, name: "line_items" }); const currency = watch("currency", "USD"); + const onSubmit: SubmitHandler = (data) => { + console.log(data); + }; + return ( -
+
{ - +

Your Items

@@ -126,6 +138,9 @@ export const InvoiceGenerator = () => { )}{" "} {currency} +
+ +
); }; -- cgit v1.3.1