From 577e98e6b1c53d63dd4430d478ed0f1e67c37296 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Wed, 1 Jul 2026 20:11:01 +0000 Subject: [PATCH] Fix TypeScript compile errors blocking Docker build - Add vite-env.d.ts for import.meta.env type support - Remove unused imports: ChevronRight, useCallback (x2), today - Silence unused attachments state read (keep setter for future use) - Fix FloatManagement changeTinTargets reducer: drop unused k, fix v type Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/Layout.tsx | 2 +- frontend/src/pages/DailyCashUp.tsx | 4 ++-- frontend/src/pages/FloatManagement.tsx | 4 ++-- frontend/src/pages/MultiDayReport.tsx | 2 +- frontend/src/vite-env.d.ts | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 frontend/src/vite-env.d.ts diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index 6b58131..4d6e814 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -1,6 +1,6 @@ import { NavLink, useNavigate } from 'react-router-dom' import { - Banknote, ClipboardList, BarChart2, Wallet, FileText, Settings, LogOut, ChevronRight, + Banknote, ClipboardList, BarChart2, Wallet, FileText, Settings, LogOut, } from 'lucide-react' import type { User } from '../types' diff --git a/frontend/src/pages/DailyCashUp.tsx b/frontend/src/pages/DailyCashUp.tsx index c69a686..f996801 100644 --- a/frontend/src/pages/DailyCashUp.tsx +++ b/frontend/src/pages/DailyCashUp.tsx @@ -1,4 +1,4 @@ -import { useState, useCallback } from 'react' +import { useState } from 'react' import { RefreshCw, Save, CheckCircle, Loader } from 'lucide-react' import { api } from '../api' import { PageHeader, Card, Btn, StatusBadge } from '../components/Layout' @@ -38,7 +38,7 @@ export function DailyCashUp({ user: _user }: Props) { const [float, setFloat] = useState(initDenominations('float')) const [machines, setMachines] = useState(initMachines()) const [notes, setNotes] = useState('') - const [attachments, setAttachments] = useState([]) + const [, setAttachments] = useState([]) const [newbookTotals, setNewbookTotals] = useState(null) const [tillPayments, setTillPayments] = useState([]) const [fetching, setFetching] = useState(false) diff --git a/frontend/src/pages/FloatManagement.tsx b/frontend/src/pages/FloatManagement.tsx index a400494..2f7fa16 100644 --- a/frontend/src/pages/FloatManagement.tsx +++ b/frontend/src/pages/FloatManagement.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useCallback } from 'react' +import { useState, useEffect } from 'react' import { Routes, Route, NavLink, Navigate, useNavigate } from 'react-router-dom' import { api } from '../api' import { PageHeader, Card, Btn } from '../components/Layout' @@ -44,7 +44,7 @@ function FloatCountForm({ type }: { type: CountType }) { const totalCounted = denoms.reduce((s, d) => s + d.value * (denomQtys[d.value] ?? 0), 0) const totalReceipts = receipts.reduce((s, r) => s + (parseFloat(r.amount) || 0), 0) const targetAmount = type === 'petty_cash' ? pettyTarget : type === 'change_tin' - ? Object.entries(changeTinTargets).reduce((s, [k, v]) => s + parseFloat(v as string || '0'), 0) + ? Object.entries(changeTinTargets).reduce((s, [, v]) => s + (v || 0), 0) : 0 const variance = type === 'petty_cash' ? totalCounted + totalReceipts - pettyTarget diff --git a/frontend/src/pages/MultiDayReport.tsx b/frontend/src/pages/MultiDayReport.tsx index f0ecb9f..1acac4e 100644 --- a/frontend/src/pages/MultiDayReport.tsx +++ b/frontend/src/pages/MultiDayReport.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { api } from '../api' import { PageHeader, Card, Btn } from '../components/Layout' -import { fmtGBP, today } from '../types' +import { fmtGBP } from '../types' interface SalesCol { gl_code: string; category: string; net_amount: number; vat_amount: number; gross_amount: number } interface ReconRow { category: string; banked_amount: number; reported_amount: number } diff --git a/frontend/src/vite-env.d.ts b/frontend/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/frontend/src/vite-env.d.ts @@ -0,0 +1 @@ +///