From a6445297dfa7bc8d341ebcf72368d410bae20605 Mon Sep 17 00:00:00 2001 From: mihna123 Date: Sun, 24 May 2026 18:28:59 +0200 Subject: style: use single quotes everywhere --- src/components/invoice-generator.tsx | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'src/components/invoice-generator.tsx') diff --git a/src/components/invoice-generator.tsx b/src/components/invoice-generator.tsx index 47cc458..da97184 100644 --- a/src/components/invoice-generator.tsx +++ b/src/components/invoice-generator.tsx @@ -1,29 +1,29 @@ -"use client"; +'use client'; -import { Invoice, InvoiceSchema } from "@/models/invoice"; -import { zodResolver } from "@hookform/resolvers/zod"; +import { Invoice, InvoiceSchema } from '@/models/invoice'; +import { zodResolver } from '@hookform/resolvers/zod'; import { useFieldArray, useForm, useWatch, SubmitHandler, -} from "react-hook-form"; -import { Input } from "./ui/input"; -import { cn } from "@/utils/cn"; -import { Button } from "./ui/button"; -import { generateInvoice } from "@/lib/generate"; +} from 'react-hook-form'; +import { Input } from './ui/input'; +import { cn } from '@/utils/cn'; +import { Button } from './ui/button'; +import { generateInvoice } from '@/lib/generate'; const defaultItem = { - description: "", + description: '', quantity: 1, rate: 0, }; const defaultValues: Invoice = { invoice_number: 0, - from: "", + from: '', line_items: [defaultItem], - currency: "USD", + currency: 'USD', }; export const InvoiceGenerator = () => { @@ -40,17 +40,17 @@ export const InvoiceGenerator = () => { const { fields, append, remove } = useFieldArray({ control, - name: "line_items", + name: 'line_items', }); - const lineItems = useWatch({ control, name: "line_items" }); - const currency = watch("currency", "USD"); + const lineItems = useWatch({ control, name: 'line_items' }); + const currency = watch('currency', 'USD'); const onSubmit: SubmitHandler = async (data) => { console.log(data); const blob = await generateInvoice(data); - const a = document.createElement("a"); + const a = document.createElement('a'); a.href = URL.createObjectURL(blob); - a.download = "invoice.pdf"; + a.download = 'invoice.pdf'; document.body.appendChild(a); a.click(); @@ -66,17 +66,17 @@ export const InvoiceGenerator = () => {
- {errors["from"] && ( -

{errors["from"].message ?? "Error"}

+ {errors['from'] && ( +

{errors['from'].message ?? 'Error'}

)}
@@ -84,7 +84,7 @@ export const InvoiceGenerator = () => {
@@ -92,20 +92,20 @@ export const InvoiceGenerator = () => {
- + - + - + - +

Your Items

Item

@@ -133,14 +133,14 @@ export const InvoiceGenerator = () => {

{( (lineItems[ind]?.rate ?? 0) * (lineItems[ind]?.quantity ?? 0) - ).toLocaleString(undefined, { style: "currency", currency })} + ).toLocaleString(undefined, { style: 'currency', currency })}

- Subtotal:{" "} + Subtotal:{' '} {lineItems .reduce( (acc, cur) => acc + (cur.rate ?? 0) * (cur.quantity ?? 0), 0, ) - .toLocaleString(undefined, { style: "currency", currency })} + .toLocaleString(undefined, { style: 'currency', currency })}
-
+
-- cgit v1.3.1