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/app/globals.css | 2 +- src/app/layout.tsx | 18 +++++----- src/app/page.tsx | 2 +- src/components/invoice-generator.tsx | 68 ++++++++++++++++++------------------ src/components/ui/button.tsx | 6 ++-- src/components/ui/input.tsx | 6 ++-- src/lib/generate.ts | 54 ++++++++++++++-------------- src/models/invoice.ts | 6 ++-- src/utils/cn.ts | 4 +-- 9 files changed, 83 insertions(+), 83 deletions(-) (limited to 'src') diff --git a/src/app/globals.css b/src/app/globals.css index 2a89a48..eb0ee21 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,4 +1,4 @@ -@import "tailwindcss"; +@import 'tailwindcss'; :root { --background: #ffffff; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 42cf8c3..be69e70 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,20 +1,20 @@ -import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; -import "./globals.css"; +import type { Metadata } from 'next'; +import { Geist, Geist_Mono } from 'next/font/google'; +import './globals.css'; const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], + variable: '--font-geist-sans', + subsets: ['latin'], }); const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], + variable: '--font-geist-mono', + subsets: ['latin'], }); export const metadata: Metadata = { - title: "Free Invoices", - description: "Generate invoices for free", + title: 'Free Invoices', + description: 'Generate invoices for free', }; export default function RootLayout({ diff --git a/src/app/page.tsx b/src/app/page.tsx index c71255f..3892b19 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,4 +1,4 @@ -import { InvoiceGenerator } from "@/components/invoice-generator"; +import { InvoiceGenerator } from '@/components/invoice-generator'; export default function Home() { return ( 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 })}
-
+
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 32b9aac..29768f6 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -1,13 +1,13 @@ -import { cn } from "@/utils/cn"; +import { cn } from '@/utils/cn'; export const Button = ({ className, ...props -}: React.ComponentPropsWithRef<"button">) => { +}: React.ComponentPropsWithRef<'button'>) => { return (