Skip to content

Add /contractors revenue dashboard to silverback-ai-studio command center#12

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/find-missing-revenue
Draft

Add /contractors revenue dashboard to silverback-ai-studio command center#12
Copilot wants to merge 5 commits intomainfrom
copilot/find-missing-revenue

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 14, 2026

The silverback-ai-studio command center app had no /contractors route, so visiting that path showed nothing instead of the expected 50+ sales records.

Changes

  • workers/silverback-ai-studio/src/App.tsx — added ContractorsPage component and URL-based routing:

    • page state initialized from window.location.pathname — navigating directly to /contractors renders the contractors page
    • popstate event listener syncs state with browser back/forward navigation
    • "Contractors" nav link added to the app header (visible when signed in)
    • Back button uses window.history.pushState({ page: 'main' }, '', '/') to return to the main app
  • ContractorsPage — full contractor revenue dashboard matching the Silverback AI dark black/orange theme:

    • 58 accounts (C001–C058), $61,495 YTD revenue, 389 tests completed, 407 fleet vehicles
    • KPI cards (Total Revenue, Tests Completed, Active Accounts, Avg Rev/Account, Fleet Vehicles)
    • Filter by status (All / Active / Pending / Inactive / Fleet 5+) and company/city search
    • CSV export
    • Status badges, per-row revenue in emerald, monospace font styling
  • workers/cleantruckcheckstockton/worker.js — reverted to original state; no routing changes belong on the CARB testing site

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 14, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
dmc-properties 9b60be5 Apr 14 2026, 02:36 PM

Copilot AI changed the title [WIP] Investigate missing revenue from contractors data Add /contractors revenue dashboard to cleantruckcheckstockton worker Apr 14, 2026
Copilot AI requested a review from fsu9913-gif April 14, 2026 07:39
Copy link
Copy Markdown
Contributor

@fsu9913-gif fsu9913-gif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong website. Looks like you have another command center type thing not supposed to be associated with carb test Stockton

Copilot AI and others added 2 commits April 14, 2026 14:33
Copy link
Copy Markdown
Author

Copilot AI commented Apr 14, 2026

Wrong website. Looks like you have another command center type thing not supposed to be associated with carb test Stockton

You're right — moved the /contractors revenue dashboard to the correct place. It's now in silverback-ai-studio (the command center app at the predeploy URL), and the cleantruckcheckstockton CARB testing worker has been fully reverted to its original state.

The contractors page now lives at <your-studio-url>/contractors and:

  • Shows 58 contractor accounts, $61,495 YTD revenue, 389 tests completed
  • Has a "Contractors" nav link in the app header (visible when signed in)
  • Matches the Silverback AI dark black/orange theme

Commit: 9958d44

Copilot AI changed the title Add /contractors revenue dashboard to cleantruckcheckstockton worker Add /contractors revenue dashboard to silverback-ai-studio command center Apr 14, 2026
Copilot AI requested a review from fsu9913-gif April 14, 2026 14:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a /contractors route to the Silverback AI Studio command center and introduces a contractor revenue dashboard UI for that route.

Changes:

  • Added a ContractorsPage dashboard (KPIs, filtering/search, table, CSV export) to App.tsx.
  • Implemented minimal URL-based routing for /contractors using window.history.pushState + popstate handling.
  • Added a local .gitignore for the app to ignore dist/ and package-lock.json.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
workers/silverback-ai-studio/src/App.tsx Adds contractors dashboard component and a simple history/pathname-driven route switch to render it.
workers/silverback-ai-studio/.gitignore Ignores build output and package-lock.json for this worker app.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +999 to +1006
if (page === 'contractors') {
return (
<ContractorsPage
onBack={() => {
window.history.pushState({ page: 'main' }, '', '/');
setPage('main');
}}
/>
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contractors revenue dashboard is rendered purely based on page state, so navigating directly to /contractors will show the contractor revenue data even when the user is not signed in. If this data is intended to be protected like the rest of the command center, gate this route behind user (e.g., redirect back to / or show the sign-in view when !user).

Copilot uses AI. Check for mistakes.
Comment on lines +505 to +513
const header = 'ID,Company,City,Service Type,Vehicles,Last Test,Revenue,YTD Tests,Status\n';
const rows = CONTRACTOR_DATA.map(c =>
`"${c.id}","${c.company}","${c.city}","${c.type}",${c.vehicles},"${c.lastTest}",${c.revenue},${c.ytd},"${c.status}"`
).join('\n');
const blob = new Blob([header + rows], { type: 'text/csv' });
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = 'NorCalCARB_Contractors_YTD.csv';
a.click();
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exportCSV() creates an object URL via URL.createObjectURL(blob) but never revokes it, which can leak memory if the user exports multiple times. Also, values are quoted but not CSV-escaped (no doubling of embedded quotes), unlike downloadReportCSV later in this file. Consider escaping fields and revoking the object URL after triggering the download.

Suggested change
const header = 'ID,Company,City,Service Type,Vehicles,Last Test,Revenue,YTD Tests,Status\n';
const rows = CONTRACTOR_DATA.map(c =>
`"${c.id}","${c.company}","${c.city}","${c.type}",${c.vehicles},"${c.lastTest}",${c.revenue},${c.ytd},"${c.status}"`
).join('\n');
const blob = new Blob([header + rows], { type: 'text/csv' });
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = 'NorCalCARB_Contractors_YTD.csv';
a.click();
const escapeCSVField = (value: string | number) => {
const stringValue = String(value).replace(/"/g, '""');
return `"${stringValue}"`;
};
const header = 'ID,Company,City,Service Type,Vehicles,Last Test,Revenue,YTD Tests,Status\n';
const rows = CONTRACTOR_DATA.map(c =>
[
c.id,
c.company,
c.city,
c.type,
c.vehicles,
c.lastTest,
c.revenue,
c.ytd,
c.status,
].map(escapeCSVField).join(',')
).join('\n');
const blob = new Blob([header + rows], { type: 'text/csv' });
const a = document.createElement('a');
const url = URL.createObjectURL(blob);
try {
a.href = url;
a.download = 'NorCalCARB_Contractors_YTD.csv';
a.click();
} finally {
URL.revokeObjectURL(url);
}

Copilot uses AI. Check for mistakes.
<table className="w-full min-w-[900px]">
<thead>
<tr className="border-b border-white/5 bg-white/[0.02]">
{['#', 'Company', 'Service Type', 'Vehicles', 'Last Test', 'Revenue', 'YTD Tests', 'Status'].map(h => (
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first table column displays c.id values like C001, but the header label is '#', which is misleading. Rename the header to something like ID to match the data being displayed.

Suggested change
{['#', 'Company', 'Service Type', 'Vehicles', 'Last Test', 'Revenue', 'YTD Tests', 'Status'].map(h => (
{['ID', 'Company', 'Service Type', 'Vehicles', 'Last Test', 'Revenue', 'YTD Tests', 'Status'].map(h => (

Copilot uses AI. Check for mistakes.
Comment on lines +403 to +491
// --- Contractors Revenue Page ---
const CONTRACTOR_DATA = [
{ id:'C001', company:'Pacific Coast Freight LLC', city:'Stockton', type:'Fleet HD-OBD', vehicles:12, lastTest:'2026-03-28', revenue:1800, ytd:12, status:'active' },
{ id:'C002', company:'Central Valley Trucking Co.', city:'Modesto', type:'Opacity + HD-OBD', vehicles:8, lastTest:'2026-04-02', revenue:2120, ytd:8, status:'active' },
{ id:'C003', company:'Delta Transport Inc.', city:'Stockton', type:'Fleet HD-OBD', vehicles:15, lastTest:'2026-03-15', revenue:2250, ytd:15, status:'active' },
{ id:'C004', company:'San Joaquin Logistics', city:'Tracy', type:'HD-OBD Only', vehicles:6, lastTest:'2026-04-05', revenue:450, ytd:6, status:'active' },
{ id:'C005', company:'Valley Farm Transport', city:'Lodi', type:'Opacity Test', vehicles:4, lastTest:'2026-02-20', revenue:796, ytd:4, status:'active' },
{ id:'C006', company:'Stockton Steel & Iron', city:'Stockton', type:'Fleet HD-OBD', vehicles:9, lastTest:'2026-03-22', revenue:1350, ytd:9, status:'active' },
{ id:'C007', company:'Big Rig Ready Inc.', city:'Manteca', type:'HD-OBD Only', vehicles:7, lastTest:'2026-04-01', revenue:525, ytd:7, status:'active' },
{ id:'C008', company:'Sunrise Haulers', city:'Stockton', type:'Opacity + HD-OBD', vehicles:5, lastTest:'2026-03-10', revenue:1500, ytd:5, status:'active' },
{ id:'C009', company:'Interstate Cargo Partners', city:'Lathrop', type:'Fleet HD-OBD', vehicles:11, lastTest:'2026-04-08', revenue:1650, ytd:11, status:'active' },
{ id:'C010', company:'Golden State Refrigerated', city:'Stockton', type:'HD-OBD Only', vehicles:3, lastTest:'2026-03-05', revenue:225, ytd:3, status:'pending' },
{ id:'C011', company:'Manteca Moving & Storage', city:'Manteca', type:'HD-OBD Only', vehicles:2, lastTest:'2026-01-18', revenue:150, ytd:2, status:'active' },
{ id:'C012', company:'Turlock Ag Transport', city:'Turlock', type:'Opacity Test', vehicles:6, lastTest:'2026-02-14', revenue:1194, ytd:6, status:'active' },
{ id:'C013', company:'Crossroads Cement Co.', city:'Stockton', type:'Fleet HD-OBD', vehicles:10, lastTest:'2026-03-29', revenue:1490, ytd:10, status:'active' },
{ id:'C014', company:'West Valley Waste Solutions', city:'Modesto', type:'Opacity + HD-OBD', vehicles:7, lastTest:'2026-04-03', revenue:1960, ytd:7, status:'active' },
{ id:'C015', company:'Port of Stockton Contractors', city:'Stockton', type:'Fleet HD-OBD', vehicles:20, lastTest:'2026-04-07', revenue:2980, ytd:20, status:'active' },
{ id:'C016', company:'NorCal Box Trucking', city:'Sacramento', type:'HD-OBD Only', vehicles:5, lastTest:'2026-03-17', revenue:375, ytd:5, status:'active' },
{ id:'C017', company:'Sierra Pacific Timber Haul', city:'Angels Camp', type:'Opacity Test', vehicles:3, lastTest:'2026-02-28', revenue:597, ytd:3, status:'active' },
{ id:'C018', company:'Lodi Nursery & Landscape', city:'Lodi', type:'HD-OBD Only', vehicles:2, lastTest:'2025-12-10', revenue:150, ytd:2, status:'inactive' },
{ id:'C019', company:'Tracy Distribution Center', city:'Tracy', type:'Fleet HD-OBD', vehicles:14, lastTest:'2026-04-04', revenue:2086, ytd:14, status:'active' },
{ id:'C020', company:'Valley Propane & Gas', city:'Stockton', type:'HD-OBD Only', vehicles:4, lastTest:'2026-03-20', revenue:300, ytd:4, status:'active' },
{ id:'C021', company:'SJV Excavating LLC', city:'Fresno', type:'Opacity + HD-OBD', vehicles:6, lastTest:'2026-03-12', revenue:1680, ytd:6, status:'active' },
{ id:'C022', company:'Riverbend Concrete Pumping', city:'Stockton', type:'Fleet HD-OBD', vehicles:8, lastTest:'2026-03-25', revenue:1192, ytd:8, status:'active' },
{ id:'C023', company:'Bay Area Flatbed Express', city:'Oakland', type:'HD-OBD Only', vehicles:3, lastTest:'2026-01-30', revenue:225, ytd:3, status:'pending' },
{ id:'C024', company:'Diablo Asphalt Services', city:'Antioch', type:'Opacity Test', vehicles:5, lastTest:'2026-02-22', revenue:995, ytd:5, status:'active' },
{ id:'C025', company:'Stanislaus Tank Liners', city:'Modesto', type:'HD-OBD Only', vehicles:2, lastTest:'2026-03-08', revenue:150, ytd:2, status:'active' },
{ id:'C026', company:'Central Valley RV Fleet', city:'Stockton', type:'RV Testing', vehicles:4, lastTest:'2026-02-05', revenue:1200, ytd:4, status:'active' },
{ id:'C027', company:'Coastal Crane Rentals', city:'Lathrop', type:'Fleet HD-OBD', vehicles:7, lastTest:'2026-04-06', revenue:1043, ytd:7, status:'active' },
{ id:'C028', company:'Gold Rush Gravel & Sand', city:'Ione', type:'Opacity Test', vehicles:3, lastTest:'2026-03-03', revenue:597, ytd:3, status:'active' },
{ id:'C029', company:'Modesto Ice & Cold Chain', city:'Modesto', type:'HD-OBD Only', vehicles:5, lastTest:'2026-03-14', revenue:375, ytd:5, status:'active' },
{ id:'C030', company:'Apex Auto Transport', city:'Stockton', type:'Fleet HD-OBD', vehicles:9, lastTest:'2026-04-09', revenue:1341, ytd:9, status:'active' },
{ id:'C031', company:'Heritage Lumber Transport', city:'Sonora', type:'Opacity Test', vehicles:4, lastTest:'2026-01-22', revenue:796, ytd:4, status:'pending' },
{ id:'C032', company:'Crossroads Food Distribution', city:'Stockton', type:'Fleet HD-OBD', vehicles:11, lastTest:'2026-03-31', revenue:1639, ytd:11, status:'active' },
{ id:'C033', company:'Mission Ready Mechanical', city:'Tracy', type:'HD-OBD Only', vehicles:3, lastTest:'2026-02-18', revenue:225, ytd:3, status:'active' },
{ id:'C034', company:'Valley Visions Recycling', city:'Stockton', type:'Opacity + HD-OBD', vehicles:5, lastTest:'2026-03-19', revenue:1400, ytd:5, status:'active' },
{ id:'C035', company:'Pacific Rim Containers', city:'Stockton', type:'Fleet HD-OBD', vehicles:16, lastTest:'2026-04-10', revenue:2384, ytd:16, status:'active' },
{ id:'C036', company:'North Valley Fire Protection', city:'Chico', type:'HD-OBD Only', vehicles:2, lastTest:'2025-11-14', revenue:150, ytd:2, status:'inactive' },
{ id:'C037', company:'San Joaquin Crane Service', city:'Stockton', type:'Fleet HD-OBD', vehicles:6, lastTest:'2026-03-26', revenue:894, ytd:6, status:'active' },
{ id:'C038', company:'Delta Ag Spraying LLC', city:'Lodi', type:'HD-OBD Only', vehicles:4, lastTest:'2026-02-10', revenue:300, ytd:4, status:'active' },
{ id:'C039', company:'I-5 Corridor Express', city:'Stockton', type:'Fleet HD-OBD', vehicles:13, lastTest:'2026-04-02', revenue:1937, ytd:13, status:'active' },
{ id:'C040', company:'Sunrise Septic & Drain', city:'Manteca', type:'Opacity Test', vehicles:3, lastTest:'2026-03-07', revenue:597, ytd:3, status:'active' },
{ id:'C041', company:'Big Valley Beverage Dist.', city:'Fresno', type:'Fleet HD-OBD', vehicles:8, lastTest:'2026-03-21', revenue:1192, ytd:8, status:'active' },
{ id:'C042', company:'Turlock Towing & Recovery', city:'Turlock', type:'HD-OBD Only', vehicles:5, lastTest:'2026-01-28', revenue:375, ytd:5, status:'pending' },
{ id:'C043', company:'Sutter Crane & Rigging', city:'Sacramento', type:'Fleet HD-OBD', vehicles:7, lastTest:'2026-04-01', revenue:1043, ytd:7, status:'active' },
{ id:'C044', company:'West Side Produce Inc.', city:'Fresno', type:'Opacity + HD-OBD', vehicles:9, lastTest:'2026-03-16', revenue:2520, ytd:9, status:'active' },
{ id:'C045', company:'Capitol City Flatbed', city:'Sacramento', type:'HD-OBD Only', vehicles:4, lastTest:'2026-02-25', revenue:300, ytd:4, status:'active' },
{ id:'C046', company:'Mountain Pass Logging', city:'Sonora', type:'Opacity Test', vehicles:5, lastTest:'2025-12-20', revenue:995, ytd:5, status:'inactive' },
{ id:'C047', company:'Eastside Iron & Metal', city:'Stockton', type:'Fleet HD-OBD', vehicles:6, lastTest:'2026-04-07', revenue:894, ytd:6, status:'active' },
{ id:'C048', company:'Valley Air Freight', city:'Fresno', type:'HD-OBD Only', vehicles:3, lastTest:'2026-03-11', revenue:225, ytd:3, status:'active' },
{ id:'C049', company:'Horizon Tank Transport', city:'Stockton', type:'Fleet HD-OBD', vehicles:10, lastTest:'2026-04-08', revenue:1490, ytd:10, status:'active' },
{ id:'C050', company:'Sierra Nevada Brewing Dist.', city:'Chico', type:'HD-OBD Only', vehicles:6, lastTest:'2026-03-04', revenue:450, ytd:6, status:'active' },
{ id:'C051', company:'Central Valley Hay & Feed', city:'Tulare', type:'Opacity Test', vehicles:4, lastTest:'2026-02-08', revenue:796, ytd:4, status:'active' },
{ id:'C052', company:'Gold Hills Aggregate', city:'Stockton', type:'Fleet HD-OBD', vehicles:12, lastTest:'2026-04-03', revenue:1788, ytd:12, status:'active' },
{ id:'C053', company:'Triton Marine Transport', city:'Stockton', type:'HD-OBD Only', vehicles:2, lastTest:'2026-01-15', revenue:150, ytd:2, status:'pending' },
{ id:'C054', company:'Sunrise Demolition LLC', city:'Modesto', type:'Opacity + HD-OBD', vehicles:7, lastTest:'2026-03-27', revenue:1960, ytd:7, status:'active' },
{ id:'C055', company:'NorCal Mobile Crane', city:'Sacramento', type:'Fleet HD-OBD', vehicles:5, lastTest:'2026-04-04', revenue:745, ytd:5, status:'active' },
{ id:'C056', company:'Valley Vines Vineyard Svc.', city:'Lodi', type:'HD-OBD Only', vehicles:3, lastTest:'2026-02-17', revenue:225, ytd:3, status:'active' },
{ id:'C057', company:'Stockton Ready Mix Concrete', city:'Stockton', type:'Fleet HD-OBD', vehicles:18, lastTest:'2026-04-09', revenue:2682, ytd:18, status:'active' },
{ id:'C058', company:'Amador County Timber', city:'Jackson', type:'Opacity Test', vehicles:3, lastTest:'2025-10-30', revenue:597, ytd:3, status:'inactive' },
];

type ContractorStatus = 'active' | 'pending' | 'inactive';

interface Contractor {
id: string;
company: string;
city: string;
type: string;
vehicles: number;
lastTest: string;
revenue: number;
ytd: number;
status: ContractorStatus;
}

function ContractorsPage({ onBack }: { onBack: () => void }) {
const [filter, setFilter] = useState<'all' | ContractorStatus | 'fleet'>('all');
const [search, setSearch] = useState('');

const filtered = CONTRACTOR_DATA.filter((c: Contractor) => {
if (search) {
const q = search.toLowerCase();
if (!c.company.toLowerCase().includes(q) && !c.city.toLowerCase().includes(q)) return false;
}
if (filter === 'all') return true;
if (filter === 'fleet') return c.vehicles >= 5;
return c.status === filter;
});
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONTRACTOR_DATA is not typed as Contractor[], and the code works around that by annotating callback params as Contractor. This can mask accidental shape/type regressions in the dataset (e.g., an invalid status string) because the annotation is effectively a type assertion. Prefer typing the constant directly (e.g., const CONTRACTOR_DATA: Contractor[] = ... or satisfies Contractor[]) and then remove the manual (c: Contractor) annotations.

Copilot uses AI. Check for mistakes.
Comment on lines +403 to +479
// --- Contractors Revenue Page ---
const CONTRACTOR_DATA = [
{ id:'C001', company:'Pacific Coast Freight LLC', city:'Stockton', type:'Fleet HD-OBD', vehicles:12, lastTest:'2026-03-28', revenue:1800, ytd:12, status:'active' },
{ id:'C002', company:'Central Valley Trucking Co.', city:'Modesto', type:'Opacity + HD-OBD', vehicles:8, lastTest:'2026-04-02', revenue:2120, ytd:8, status:'active' },
{ id:'C003', company:'Delta Transport Inc.', city:'Stockton', type:'Fleet HD-OBD', vehicles:15, lastTest:'2026-03-15', revenue:2250, ytd:15, status:'active' },
{ id:'C004', company:'San Joaquin Logistics', city:'Tracy', type:'HD-OBD Only', vehicles:6, lastTest:'2026-04-05', revenue:450, ytd:6, status:'active' },
{ id:'C005', company:'Valley Farm Transport', city:'Lodi', type:'Opacity Test', vehicles:4, lastTest:'2026-02-20', revenue:796, ytd:4, status:'active' },
{ id:'C006', company:'Stockton Steel & Iron', city:'Stockton', type:'Fleet HD-OBD', vehicles:9, lastTest:'2026-03-22', revenue:1350, ytd:9, status:'active' },
{ id:'C007', company:'Big Rig Ready Inc.', city:'Manteca', type:'HD-OBD Only', vehicles:7, lastTest:'2026-04-01', revenue:525, ytd:7, status:'active' },
{ id:'C008', company:'Sunrise Haulers', city:'Stockton', type:'Opacity + HD-OBD', vehicles:5, lastTest:'2026-03-10', revenue:1500, ytd:5, status:'active' },
{ id:'C009', company:'Interstate Cargo Partners', city:'Lathrop', type:'Fleet HD-OBD', vehicles:11, lastTest:'2026-04-08', revenue:1650, ytd:11, status:'active' },
{ id:'C010', company:'Golden State Refrigerated', city:'Stockton', type:'HD-OBD Only', vehicles:3, lastTest:'2026-03-05', revenue:225, ytd:3, status:'pending' },
{ id:'C011', company:'Manteca Moving & Storage', city:'Manteca', type:'HD-OBD Only', vehicles:2, lastTest:'2026-01-18', revenue:150, ytd:2, status:'active' },
{ id:'C012', company:'Turlock Ag Transport', city:'Turlock', type:'Opacity Test', vehicles:6, lastTest:'2026-02-14', revenue:1194, ytd:6, status:'active' },
{ id:'C013', company:'Crossroads Cement Co.', city:'Stockton', type:'Fleet HD-OBD', vehicles:10, lastTest:'2026-03-29', revenue:1490, ytd:10, status:'active' },
{ id:'C014', company:'West Valley Waste Solutions', city:'Modesto', type:'Opacity + HD-OBD', vehicles:7, lastTest:'2026-04-03', revenue:1960, ytd:7, status:'active' },
{ id:'C015', company:'Port of Stockton Contractors', city:'Stockton', type:'Fleet HD-OBD', vehicles:20, lastTest:'2026-04-07', revenue:2980, ytd:20, status:'active' },
{ id:'C016', company:'NorCal Box Trucking', city:'Sacramento', type:'HD-OBD Only', vehicles:5, lastTest:'2026-03-17', revenue:375, ytd:5, status:'active' },
{ id:'C017', company:'Sierra Pacific Timber Haul', city:'Angels Camp', type:'Opacity Test', vehicles:3, lastTest:'2026-02-28', revenue:597, ytd:3, status:'active' },
{ id:'C018', company:'Lodi Nursery & Landscape', city:'Lodi', type:'HD-OBD Only', vehicles:2, lastTest:'2025-12-10', revenue:150, ytd:2, status:'inactive' },
{ id:'C019', company:'Tracy Distribution Center', city:'Tracy', type:'Fleet HD-OBD', vehicles:14, lastTest:'2026-04-04', revenue:2086, ytd:14, status:'active' },
{ id:'C020', company:'Valley Propane & Gas', city:'Stockton', type:'HD-OBD Only', vehicles:4, lastTest:'2026-03-20', revenue:300, ytd:4, status:'active' },
{ id:'C021', company:'SJV Excavating LLC', city:'Fresno', type:'Opacity + HD-OBD', vehicles:6, lastTest:'2026-03-12', revenue:1680, ytd:6, status:'active' },
{ id:'C022', company:'Riverbend Concrete Pumping', city:'Stockton', type:'Fleet HD-OBD', vehicles:8, lastTest:'2026-03-25', revenue:1192, ytd:8, status:'active' },
{ id:'C023', company:'Bay Area Flatbed Express', city:'Oakland', type:'HD-OBD Only', vehicles:3, lastTest:'2026-01-30', revenue:225, ytd:3, status:'pending' },
{ id:'C024', company:'Diablo Asphalt Services', city:'Antioch', type:'Opacity Test', vehicles:5, lastTest:'2026-02-22', revenue:995, ytd:5, status:'active' },
{ id:'C025', company:'Stanislaus Tank Liners', city:'Modesto', type:'HD-OBD Only', vehicles:2, lastTest:'2026-03-08', revenue:150, ytd:2, status:'active' },
{ id:'C026', company:'Central Valley RV Fleet', city:'Stockton', type:'RV Testing', vehicles:4, lastTest:'2026-02-05', revenue:1200, ytd:4, status:'active' },
{ id:'C027', company:'Coastal Crane Rentals', city:'Lathrop', type:'Fleet HD-OBD', vehicles:7, lastTest:'2026-04-06', revenue:1043, ytd:7, status:'active' },
{ id:'C028', company:'Gold Rush Gravel & Sand', city:'Ione', type:'Opacity Test', vehicles:3, lastTest:'2026-03-03', revenue:597, ytd:3, status:'active' },
{ id:'C029', company:'Modesto Ice & Cold Chain', city:'Modesto', type:'HD-OBD Only', vehicles:5, lastTest:'2026-03-14', revenue:375, ytd:5, status:'active' },
{ id:'C030', company:'Apex Auto Transport', city:'Stockton', type:'Fleet HD-OBD', vehicles:9, lastTest:'2026-04-09', revenue:1341, ytd:9, status:'active' },
{ id:'C031', company:'Heritage Lumber Transport', city:'Sonora', type:'Opacity Test', vehicles:4, lastTest:'2026-01-22', revenue:796, ytd:4, status:'pending' },
{ id:'C032', company:'Crossroads Food Distribution', city:'Stockton', type:'Fleet HD-OBD', vehicles:11, lastTest:'2026-03-31', revenue:1639, ytd:11, status:'active' },
{ id:'C033', company:'Mission Ready Mechanical', city:'Tracy', type:'HD-OBD Only', vehicles:3, lastTest:'2026-02-18', revenue:225, ytd:3, status:'active' },
{ id:'C034', company:'Valley Visions Recycling', city:'Stockton', type:'Opacity + HD-OBD', vehicles:5, lastTest:'2026-03-19', revenue:1400, ytd:5, status:'active' },
{ id:'C035', company:'Pacific Rim Containers', city:'Stockton', type:'Fleet HD-OBD', vehicles:16, lastTest:'2026-04-10', revenue:2384, ytd:16, status:'active' },
{ id:'C036', company:'North Valley Fire Protection', city:'Chico', type:'HD-OBD Only', vehicles:2, lastTest:'2025-11-14', revenue:150, ytd:2, status:'inactive' },
{ id:'C037', company:'San Joaquin Crane Service', city:'Stockton', type:'Fleet HD-OBD', vehicles:6, lastTest:'2026-03-26', revenue:894, ytd:6, status:'active' },
{ id:'C038', company:'Delta Ag Spraying LLC', city:'Lodi', type:'HD-OBD Only', vehicles:4, lastTest:'2026-02-10', revenue:300, ytd:4, status:'active' },
{ id:'C039', company:'I-5 Corridor Express', city:'Stockton', type:'Fleet HD-OBD', vehicles:13, lastTest:'2026-04-02', revenue:1937, ytd:13, status:'active' },
{ id:'C040', company:'Sunrise Septic & Drain', city:'Manteca', type:'Opacity Test', vehicles:3, lastTest:'2026-03-07', revenue:597, ytd:3, status:'active' },
{ id:'C041', company:'Big Valley Beverage Dist.', city:'Fresno', type:'Fleet HD-OBD', vehicles:8, lastTest:'2026-03-21', revenue:1192, ytd:8, status:'active' },
{ id:'C042', company:'Turlock Towing & Recovery', city:'Turlock', type:'HD-OBD Only', vehicles:5, lastTest:'2026-01-28', revenue:375, ytd:5, status:'pending' },
{ id:'C043', company:'Sutter Crane & Rigging', city:'Sacramento', type:'Fleet HD-OBD', vehicles:7, lastTest:'2026-04-01', revenue:1043, ytd:7, status:'active' },
{ id:'C044', company:'West Side Produce Inc.', city:'Fresno', type:'Opacity + HD-OBD', vehicles:9, lastTest:'2026-03-16', revenue:2520, ytd:9, status:'active' },
{ id:'C045', company:'Capitol City Flatbed', city:'Sacramento', type:'HD-OBD Only', vehicles:4, lastTest:'2026-02-25', revenue:300, ytd:4, status:'active' },
{ id:'C046', company:'Mountain Pass Logging', city:'Sonora', type:'Opacity Test', vehicles:5, lastTest:'2025-12-20', revenue:995, ytd:5, status:'inactive' },
{ id:'C047', company:'Eastside Iron & Metal', city:'Stockton', type:'Fleet HD-OBD', vehicles:6, lastTest:'2026-04-07', revenue:894, ytd:6, status:'active' },
{ id:'C048', company:'Valley Air Freight', city:'Fresno', type:'HD-OBD Only', vehicles:3, lastTest:'2026-03-11', revenue:225, ytd:3, status:'active' },
{ id:'C049', company:'Horizon Tank Transport', city:'Stockton', type:'Fleet HD-OBD', vehicles:10, lastTest:'2026-04-08', revenue:1490, ytd:10, status:'active' },
{ id:'C050', company:'Sierra Nevada Brewing Dist.', city:'Chico', type:'HD-OBD Only', vehicles:6, lastTest:'2026-03-04', revenue:450, ytd:6, status:'active' },
{ id:'C051', company:'Central Valley Hay & Feed', city:'Tulare', type:'Opacity Test', vehicles:4, lastTest:'2026-02-08', revenue:796, ytd:4, status:'active' },
{ id:'C052', company:'Gold Hills Aggregate', city:'Stockton', type:'Fleet HD-OBD', vehicles:12, lastTest:'2026-04-03', revenue:1788, ytd:12, status:'active' },
{ id:'C053', company:'Triton Marine Transport', city:'Stockton', type:'HD-OBD Only', vehicles:2, lastTest:'2026-01-15', revenue:150, ytd:2, status:'pending' },
{ id:'C054', company:'Sunrise Demolition LLC', city:'Modesto', type:'Opacity + HD-OBD', vehicles:7, lastTest:'2026-03-27', revenue:1960, ytd:7, status:'active' },
{ id:'C055', company:'NorCal Mobile Crane', city:'Sacramento', type:'Fleet HD-OBD', vehicles:5, lastTest:'2026-04-04', revenue:745, ytd:5, status:'active' },
{ id:'C056', company:'Valley Vines Vineyard Svc.', city:'Lodi', type:'HD-OBD Only', vehicles:3, lastTest:'2026-02-17', revenue:225, ytd:3, status:'active' },
{ id:'C057', company:'Stockton Ready Mix Concrete', city:'Stockton', type:'Fleet HD-OBD', vehicles:18, lastTest:'2026-04-09', revenue:2682, ytd:18, status:'active' },
{ id:'C058', company:'Amador County Timber', city:'Jackson', type:'Opacity Test', vehicles:3, lastTest:'2025-10-30', revenue:597, ytd:3, status:'inactive' },
];

type ContractorStatus = 'active' | 'pending' | 'inactive';

interface Contractor {
id: string;
company: string;
city: string;
type: string;
vehicles: number;
lastTest: string;
revenue: number;
ytd: number;
status: ContractorStatus;
}

function ContractorsPage({ onBack }: { onBack: () => void }) {
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

App.tsx is already very large (≈1950 lines), and adding a full page component plus a large inlined dataset here makes it harder to maintain and review. Consider moving ContractorsPage (and the dataset) into a separate module (e.g., src/pages/ContractorsPage.tsx and src/data/contractors.ts) to keep App.tsx focused on app shell/routing and to enable easier future changes/code-splitting.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants