From 3b19b94e4adb0cd260ced69fde6b9030e103c289 Mon Sep 17 00:00:00 2001 From: rxshellg Date: Thu, 12 Feb 2026 00:07:18 -0500 Subject: [PATCH] Formatted code with Prettier --- .github/workflows/ci.yml | 2 +- api/ocr.ts | 33 +- index.html | 5 +- src/App.tsx | 16 +- src/components/AssignItemModal.module.css | 4 +- src/components/Footer.module.css | 30 +- src/components/Footer.tsx | 45 +-- src/components/Navbar.module.css | 38 +-- src/components/Navbar.tsx | 18 +- .../PeopleManager/AddPersonModal.module.css | 4 +- .../PeopleManager/AddPersonModal.tsx | 12 +- src/components/PeopleManager/PeopleChips.tsx | 14 +- src/components/PeopleManager/index.ts | 2 +- .../PeopleManager/styles.module.css | 13 +- src/components/PeopleManager/usePeople.ts | 10 +- src/hooks/useIsMobile.ts | 10 +- src/index.css | 32 +- src/main.tsx | 14 +- src/pages/Calculator.module.css | 135 ++++---- src/pages/Calculator.tsx | 227 +++++++------- src/pages/Home.module.css | 74 ++--- src/pages/Home.tsx | 294 ++++++++++-------- src/pages/Review.tsx | 49 +-- src/pages/Split.module.css | 76 ++--- src/types/index.ts | 6 +- src/utils/parseReceipt.ts | 10 +- 26 files changed, 624 insertions(+), 549 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1054683..b1f1231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,4 +32,4 @@ jobs: run: npm audit --audit-level=moderate || echo "Security audit completed with issues" # - name: 🧪 Run Jest Tests -# run: npm test \ No newline at end of file +# run: npm test diff --git a/api/ocr.ts b/api/ocr.ts index b373987..b143109 100644 --- a/api/ocr.ts +++ b/api/ocr.ts @@ -5,8 +5,8 @@ import fs from "node:fs/promises"; export const config = { api: { bodyParser: false, - maxDuration: 10 - } + maxDuration: 10, + }, }; type VisionAnnotateResponse = { @@ -28,15 +28,21 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { multiples: false, maxFileSize: 8 * 1024 * 1024, filter: (part) => - part.mimetype ? /^image\/(png|jpe?g|webp)$/i.test(part.mimetype) : false + part.mimetype + ? /^image\/(png|jpe?g|webp)$/i.test(part.mimetype) + : false, }); - const { files } = await new Promise<{ files: FormidableFiles }>((resolve, reject) => - form.parse(req, (err, _fields, files) => (err ? reject(err) : resolve({ files }))) + const { files } = await new Promise<{ files: FormidableFiles }>( + (resolve, reject) => + form.parse(req, (err, _fields, files) => + err ? reject(err) : resolve({ files }), + ), ); const file = Array.isArray(files.file) ? files.file[0] : files.file; - if (!file?.filepath) return res.status(400).json({ error: "No file uploaded" }); + if (!file?.filepath) + return res.status(400).json({ error: "No file uploaded" }); const buf = await fs.readFile(file.filepath); const content = buf.toString("base64"); @@ -51,11 +57,11 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { requests: [ { image: { content }, - features: [{ type: "TEXT_DETECTION" }] - } - ] - }) - } + features: [{ type: "TEXT_DETECTION" }], + }, + ], + }), + }, ); if (!r.ok) { @@ -70,11 +76,12 @@ export default async function handler(req: VercelRequest, res: VercelResponse) { resp?.textAnnotations?.[0]?.description ?? ""; - if (!text) return res.status(200).json({ text: "", warning: "No text found" }); + if (!text) + return res.status(200).json({ text: "", warning: "No text found" }); return res.status(200).json({ text }); } catch (err: unknown) { const msg = err instanceof Error ? err.message : "OCR failed"; console.error(err); return res.status(500).json({ error: msg }); } -} \ No newline at end of file +} diff --git a/index.html b/index.html index cbae255..151fac2 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,10 @@ Bill Buddy - + diff --git a/src/App.tsx b/src/App.tsx index fce7c43..ea3246b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,11 +1,11 @@ -import { Routes, Route } from 'react-router-dom'; +import { Routes, Route } from "react-router-dom"; -import Calculator from './pages/Calculator'; -import Footer from './components/Footer'; -import Home from './pages/Home'; -import Navbar from './components/Navbar'; -import Review from './pages/Review'; -import Split from './pages/Split'; +import Calculator from "./pages/Calculator"; +import Footer from "./components/Footer"; +import Home from "./pages/Home"; +import Navbar from "./components/Navbar"; +import Review from "./pages/Review"; +import Split from "./pages/Split"; const App = () => { return ( @@ -19,7 +19,7 @@ const App = () => {