import React, { useState, useEffect } from "react"; import { base44 } from "@/api/base44Client"; import { useQuery } from "@tanstack/react-query"; import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Dialog, DialogContent, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import { DollarSign, TrendingUp, Award, FileText, BarChart3, Shield, Calendar, Download, Upload, CheckCircle2, AlertCircle, Target, Building2, Users, LineChart, PieChart, Plus, Edit, Search, ChevronLeft, ChevronRight, Clock, // Added Clock icon for onboarding tab X // Added X icon for closing dialog/panel } from "lucide-react"; import StatsCard from "../components/staff/StatsCard"; import W9FormViewer from "../components/procurement/W9FormViewer"; import COIViewer from "../components/procurement/COIViewer"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import VendorDetailModal from "../components/procurement/VendorDetailModal"; import VendorHoverCard from "../components/procurement/VendorHoverCard"; import VendorScoreHoverCard from "../components/procurement/VendorScoreHoverCard"; // Added this import import PageHeader from "../components/common/PageHeader"; import { useToast } from "@/components/ui/use-toast"; // Import useToast export default function ProcurementDashboard() { const [selectedYear, setSelectedYear] = useState("2025"); const [comparisonYear, setComparisonYear] = useState("2024"); const [selectedRegion, setSelectedRegion] = useState("all"); const [selectedVendor, setSelectedVendor] = useState("all"); const [selectedClient, setSelectedClient] = useState("all"); const [showW9Form, setShowW9Form] = useState(false); const [showCOIViewer, setShowCOIViewer] = useState(false); // New states for vendor directory filters and pagination const [vendorSearch, setVendorSearch] = useState(""); const [vendorRegionFilter, setVendorRegionFilter] = useState("all"); const [vendorSpecialtyFilter, setVendorSpecialtyFilter] = useState("all"); const [vendorStateFilter, setVendorStateFilter] = useState("all"); const [vendorSoftwareFilter, setVendorSoftwareFilter] = useState("all"); const [currentPage, setCurrentPage] = useState(1); const [itemsPerPage, setItemsPerPage] = useState(10); const [viewMode, setViewMode] = useState("table"); // table or grid - currently only table is implemented // New states for vendor detail modal const [selectedVendorForDetail, setSelectedVendorForDetail] = useState(null); const [showVendorDetail, setShowVendorDetail] = useState(false); // New states for supplier onboarding tab const [selectedSupplier, setSelectedSupplier] = useState(null); const [supplierSearch, setSupplierSearch] = useState(""); const [supplierRegionFilter, setSupplierRegionFilter] = useState("all"); const [supplierCityFilter, setSupplierCityFilter] = useState("all"); const [supplierStateFilter, setSupplierStateFilter] = useState("all"); // NEW const [supplierStatusFilter, setSupplierStatusFilter] = useState("all"); // NEW const [supplierDocumentFilter, setSupplierDocumentFilter] = useState("all"); // NEW const { toast } = useToast(); // Initialize useToast const vendors = [ { name: "Legendary Event Staffing", region: "Bay Area", state: "California", specialty: "Full Service Events", software: "Building platform (KROW)", softwareType: "building", employees: 450, fillRate: 97, onTimeRate: 98, csat: 4.7, spend: "$230k" }, { name: "Instawork", region: "National", state: "Multiple", specialty: "On-Demand Gig Platform", software: "Full Platform", softwareType: "platform", employees: 5000, fillRate: 95, onTimeRate: 96, csat: 4.5, spend: "$215k" }, { name: "Hospitality Staffing Solutions (HSS)", region: "Multi-Region", state: "Multiple", specialty: "Hospitality", software: "Partial Tech", softwareType: "partial", employees: 1250, fillRate: 94, onTimeRate: 95, csat: 4.4, spend: "$198k" }, { name: "Bluecrew", region: "National", state: "Multiple", specialty: "W-2 Staffing Platform", software: "Full Platform", softwareType: "platform", employees: 3500, fillRate: 92, onTimeRate: 94, csat: 4.2, spend: "$185k" }, { name: "Qwick", region: "Multi-Region", state: "Multiple", specialty: "Hospitality Platform", software: "Full Platform", softwareType: "platform", employees: 2800, fillRate: 91, onTimeRate: 93, csat: 4.1, spend: "$172k" }, { name: "NorCal Staffing", region: "Northern California", state: "California", specialty: "Event-based staffing", software: "Traditional", softwareType: "traditional", employees: 280, fillRate: 89, onTimeRate: 91, csat: 3.9, spend: "$156k" }, { name: "Jeff Duerson Staffing", region: "Bay Area", state: "California", specialty: "Catering/Events", software: "Traditional", softwareType: "traditional", employees: 175, fillRate: 88, onTimeRate: 90, csat: 3.8, spend: "$142k" }, { name: "The Party Staff", region: "Bay Area", state: "California", specialty: "Event Staffing", software: "Internal System", softwareType: "traditional", employees: 320, fillRate: 87, onTimeRate: 89, csat: 3.7, spend: "$138k" }, { name: "Flagship Culinary Services", region: "Bay Area", state: "California", specialty: "Culinary", software: "Internal System", softwareType: "partial", employees: 380, fillRate: 86, onTimeRate: 88, csat: 3.6, spend: "$125k" }, { name: "Elite Hospitality Staffing", region: "Bay Area", state: "California", specialty: "Hotels/Events", software: "Traditional", softwareType: "traditional", employees: 290, fillRate: 85, onTimeRate: 87, csat: 3.5, spend: "$118k" }, { name: "Kitchen & Cater Staffing", region: "Local", state: "California", specialty: "Catering", software: "Traditional", softwareType: "traditional", employees: 125, fillRate: 83, onTimeRate: 85, csat: 3.4, spend: "$95k" }, ]; const onboardingSuppliers = [ // Bay Area - California { name: "Legendary Event Staffing", ein: "45-8892013", region: "Bay Area", city: "San Francisco", state: "California", documents: [ { type: "W9", status: "Approved", expires: "03/12/2026", uploadedBy: "Jane Smith", uploadDate: "01/15/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/10/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Jane Smith", uploadDate: "01/05/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Jane Smith", uploadDate: "01/15/2025" }, { type: "Background Check", status: "Approved", expires: "06/30/2026", uploadedBy: "System", uploadDate: "12/20/2024" }, ] }, { name: "The Party Staff", ein: "93-1012832", region: "Bay Area", city: "Oakland", state: "California", documents: [ { type: "W9", status: "Approved", expires: "03/12/2026", uploadedBy: "Admin", uploadDate: "01/10/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/05/2025" }, { type: "NDA", status: "Missing", expires: "-", uploadedBy: "-", uploadDate: "-" }, { type: "Contract", status: "Pending", expires: "-", uploadedBy: "-", uploadDate: "-" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/08/2025" }, { type: "Background Check", status: "Approved", expires: "09/30/2026", uploadedBy: "System", uploadDate: "12/15/2024" }, ] }, { name: "Elite Hospitality Staffing", ein: "72-2281034", region: "Bay Area", city: "San Francisco", state: "California", documents: [ { type: "W9", status: "Approved", expires: "08/15/2026", uploadedBy: "ComplianceBot", uploadDate: "01/12/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/08/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/10/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "ComplianceBot", uploadDate: "01/12/2025" }, { type: "Background Check", status: "Approved", expires: "07/20/2026", uploadedBy: "System", uploadDate: "01/02/2025" }, ] }, { name: "Jeff Duerson Staffing", ein: "55-3029841", region: "Bay Area", city: "San Jose", state: "California", documents: [ { type: "W9", status: "Approved", expires: "03/12/2026", uploadedBy: "Admin", uploadDate: "01/14/2025" }, { type: "COI", status: "Approved", expires: "02/18/2026", uploadedBy: "Admin", uploadDate: "02/18/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/05/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/14/2025" }, { type: "Background Check", status: "Approved", expires: "10/10/2026", uploadedBy: "System", uploadDate: "01/01/2025" }, ] }, { name: "Flagship Culinary Services", ein: "81-9982734", region: "Bay Area", city: "Palo Alto", state: "California", documents: [ { type: "W9", status: "Approved", expires: "03/12/2026", uploadedBy: "System", uploadDate: "01/11/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/08/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/10/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/11/2025" }, { type: "Background Check", status: "Approved", expires: "09/09/2026", uploadedBy: "System", uploadDate: "12/28/2024" }, ] }, // Southern California { name: "LA Event Professionals", ein: "44-1209382", region: "Southern California", city: "Los Angeles", state: "California", documents: [ { type: "W9", status: "Approved", expires: "05/11/2026", uploadedBy: "Admin", uploadDate: "01/16/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/09/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/12/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/16/2025" }, { type: "Background Check", status: "Approved", expires: "11/15/2026", uploadedBy: "System", uploadDate: "01/03/2025" }, ] }, { name: "Hollywood Hospitality", ein: "71-2817364", region: "Southern California", city: "Los Angeles", state: "California", documents: [ { type: "W9", status: "Approved", expires: "03/12/2026", uploadedBy: "System", uploadDate: "01/13/2025" }, { type: "COI", status: "Expiring Soon", expires: "12/20/2025", uploadedBy: "System", uploadDate: "12/20/2024" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/08/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/13/2025" }, { type: "Background Check", status: "Approved", expires: "06/25/2026", uploadedBy: "System", uploadDate: "12/30/2024" }, ] }, { name: "San Diego Event Staff", ein: "67-4738291", region: "Southern California", city: "San Diego", state: "California", documents: [ { type: "W9", status: "Approved", expires: "03/12/2026", uploadedBy: "Admin", uploadDate: "01/15/2025" }, { type: "COI", status: "Missing", expires: "-", uploadedBy: "-", uploadDate: "-" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/10/2025" }, { type: "Contract", status: "Pending", expires: "-", uploadedBy: "-", uploadDate: "-" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/15/2025" }, { type: "Background Check", status: "Approved", expires: "08/30/2026", uploadedBy: "System", uploadDate: "01/05/2025" }, ] }, { name: "OC Staffing Solutions", ein: "92-1982734", region: "Southern California", city: "Orange County", state: "California", documents: [ { type: "W9", status: "Approved", expires: "04/14/2026", uploadedBy: "Jane Smith", uploadDate: "01/17/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/10/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Jane Smith", uploadDate: "01/11/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Jane Smith", uploadDate: "01/17/2025" }, { type: "Background Check", status: "Approved", expires: "09/20/2026", uploadedBy: "System", uploadDate: "01/02/2025" }, ] }, // Northern California { name: "NorCal Staffing", ein: "22-3344556", region: "Northern California", city: "Sacramento", state: "California", documents: [ { type: "W9", status: "Approved", expires: "06/20/2026", uploadedBy: "Admin", uploadDate: "01/18/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/12/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/15/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/18/2025" }, { type: "Background Check", status: "Approved", expires: "08/15/2026", uploadedBy: "System", uploadDate: "01/04/2025" }, ] }, { name: "Kitchen & Cater Staffing", ein: "33-5566778", region: "Northern California", city: "Sacramento", state: "California", documents: [ { type: "W9", status: "Approved", expires: "07/25/2026", uploadedBy: "System", uploadDate: "01/19/2025" }, { type: "COI", status: "Expiring Soon", expires: "11/15/2025", uploadedBy: "System", uploadDate: "11/15/2024" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/12/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/19/2025" }, { type: "Background Check", status: "Approved", expires: "09/25/2026", uploadedBy: "System", uploadDate: "01/06/2025" }, ] }, // National Platforms { name: "Instawork", ein: "18-5629931", region: "National", city: "Multiple", state: "Multiple", documents: [ { type: "W9", status: "Approved", expires: "03/12/2026", uploadedBy: "System", uploadDate: "02/01/2025" }, { type: "COI", status: "Expiring Soon", expires: "11/10/2025", uploadedBy: "System", uploadDate: "11/10/2024" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/15/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/20/2025" }, { type: "Background Check", status: "Approved", expires: "08/15/2026", uploadedBy: "System", uploadDate: "01/05/2025" }, ] }, { name: "Hospitality Staffing Solutions (HSS)", ein: "44-6677889", region: "National", city: "Multiple", state: "Multiple", documents: [ { type: "W9", status: "Approved", expires: "05/30/2026", uploadedBy: "Admin", uploadDate: "01/22/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/18/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/20/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/22/2025" }, { type: "Background Check", status: "Approved", expires: "10/30/2026", uploadedBy: "System", uploadDate: "01/08/2025" }, ] }, { name: "Bluecrew", ein: "55-7788990", region: "National", city: "Multiple", state: "Multiple", documents: [ { type: "W9", status: "Approved", expires: "04/18/2026", uploadedBy: "System", uploadDate: "01/21/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/17/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/19/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/21/2025" }, { type: "Background Check", status: "Approved", expires: "11/20/2026", uploadedBy: "System", uploadDate: "01/07/2025" }, ] }, { name: "Qwick", ein: "66-8899001", region: "National", city: "Multiple", state: "Multiple", documents: [ { type: "W9", status: "Approved", expires: "06/22/2026", uploadedBy: "Admin", uploadDate: "01/23/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/19/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/21/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/23/2025" }, { type: "Background Check", status: "Approved", expires: "12/15/2026", uploadedBy: "System", uploadDate: "01/09/2025" }, ] }, // New York { name: "NYC Event Masters", ein: "77-9900112", region: "East Coast", city: "New York City", state: "New York", documents: [ { type: "W9", status: "Approved", expires: "08/30/2026", uploadedBy: "Admin", uploadDate: "01/24/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/20/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/22/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/24/2025" }, { type: "Background Check", status: "Approved", expires: "07/30/2026", uploadedBy: "System", uploadDate: "01/10/2025" }, ] }, { name: "Manhattan Staffing Group", ein: "88-0011223", region: "East Coast", city: "Manhattan", state: "New York", documents: [ { type: "W9", status: "Approved", expires: "09/15/2026", uploadedBy: "System", uploadDate: "01/25/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/21/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/23/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/25/2025" }, { type: "Background Check", status: "Approved", expires: "10/15/2026", uploadedBy: "System", uploadDate: "01/11/2025" }, ] }, { name: "Brooklyn Event Pros", ein: "99-1122334", region: "East Coast", city: "Brooklyn", state: "New York", documents: [ { type: "W9", status: "Approved", expires: "07/10/2026", uploadedBy: "Admin", uploadDate: "01/26/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/22/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/24/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/26/2025" }, { type: "Background Check", status: "Expiring Soon", expires: "11/25/2025", uploadedBy: "System", uploadDate: "11/25/2024" }, ] }, { name: "Upstate Event Services", ein: "11-2233445", region: "East Coast", city: "Buffalo", state: "New York", documents: [ { type: "W9", status: "Approved", expires: "05/25/2026", uploadedBy: "System", uploadDate: "01/27/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/23/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/25/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/27/2025" }, { type: "Background Check", status: "Approved", expires: "06/15/2026", uploadedBy: "System", uploadDate: "12/18/2024" }, ] }, // Texas { name: "Lone Star Staffing", ein: "22-3344556", region: "South", city: "Austin", state: "Texas", documents: [ { type: "W9", status: "Approved", expires: "08/05/2026", uploadedBy: "Admin", uploadDate: "01/28/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/24/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/26/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "01/28/2025" }, { type: "Background Check", status: "Approved", expires: "09/10/2026", uploadedBy: "System", uploadDate: "01/12/2025" }, ] }, { name: "Houston Hospitality Hub", ein: "33-4455667", region: "South", city: "Houston", state: "Texas", documents: [ { type: "W9", status: "Approved", expires: "04/28/2026", uploadedBy: "System", uploadDate: "01/29/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/25/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/27/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/29/2025" }, { type: "Background Check", status: "Approved", expires: "10/20/2026", uploadedBy: "System", uploadDate: "01/13/2025" }, ] }, { name: "Dallas Event Specialists", ein: "44-5566778", region: "South", city: "Dallas", state: "Texas", documents: [ { type: "W9", status: "Approved", expires: "06/12/2026", uploadedBy: "Admin", uploadDate: "01/30/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/26/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/28/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Pending", expires: "-", uploadedBy: "-", uploadDate: "-" }, { type: "Background Check", status: "Approved", expires: "08/25/2026", uploadedBy: "System", uploadDate: "01/14/2025" }, ] }, { name: "San Antonio Services", ein: "55-6677889", region: "South", city: "San Antonio", state: "Texas", documents: [ { type: "W9", status: "Approved", expires: "07/18/2026", uploadedBy: "System", uploadDate: "01/31/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/27/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/29/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "01/31/2025" }, { type: "Background Check", status: "Approved", expires: "11/10/2026", uploadedBy: "System", uploadDate: "01/15/2025" }, ] }, // Illinois { name: "Chicago Event Staffing", ein: "66-7788990", region: "Midwest", city: "Chicago", state: "Illinois", documents: [ { type: "W9", status: "Approved", expires: "05/05/2026", uploadedBy: "Admin", uploadDate: "02/01/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/28/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/30/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "02/01/2025" }, { type: "Background Check", status: "Approved", expires: "07/15/2026", uploadedBy: "System", uploadDate: "01/16/2025" }, ] }, { name: "Windy City Hospitality", ein: "77-8899001", region: "Midwest", city: "Chicago", state: "Illinois", documents: [ { type: "W9", status: "Approved", expires: "09/20/2026", uploadedBy: "System", uploadDate: "02/02/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/29/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "01/31/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "02/02/2025" }, { type: "Background Check", status: "Approved", expires: "08/30/2026", uploadedBy: "System", uploadDate: "01/17/2025" }, ] }, // Florida { name: "Miami Event Solutions", ein: "88-9900112", region: "South", city: "Miami", state: "Florida", documents: [ { type: "W9", status: "Approved", expires: "04/15/2026", uploadedBy: "Admin", uploadDate: "02/03/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/30/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/01/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "02/03/2025" }, { type: "Background Check", status: "Approved", expires: "09/20/2026", uploadedBy: "System", uploadDate: "01/18/2025" }, ] }, { name: "Orlando Hospitality Group", ein: "99-0011223", region: "South", city: "Orlando", state: "Florida", documents: [ { type: "W9", status: "Approved", expires: "06/08/2026", uploadedBy: "System", uploadDate: "02/04/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "01/31/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/02/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "02/04/2025" }, { type: "Background Check", status: "Approved", expires: "11/30/2026", uploadedBy: "System", uploadDate: "01/19/2025" }, ] }, { name: "Tampa Bay Staffing", ein: "11-1122334", region: "South", city: "Tampa", state: "Florida", documents: [ { type: "W9", status: "Approved", expires: "05/20/2026", uploadedBy: "Admin", uploadDate: "02/05/2025" }, { type: "COI", status: "Expiring Soon", expires: "11/30/2025", uploadedBy: "System", uploadDate: "11/30/2024" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/03/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "02/05/2025" }, { type: "Background Check", status: "Approved", expires: "10/05/2026", uploadedBy: "System", uploadDate: "01/20/2025" }, ] }, // Washington { name: "Seattle Event Pros", ein: "22-2233445", region: "West", city: "Seattle", state: "Washington", documents: [ { type: "W9", status: "Approved", expires: "08/12/2026", uploadedBy: "System", uploadDate: "02/06/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "02/01/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/04/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "02/06/2025" }, { type: "Background Check", status: "Approved", expires: "12/10/2026", uploadedBy: "System", uploadDate: "01/21/2025" }, ] }, { name: "Pacific Northwest Staffing", ein: "33-3344556", region: "West", city: "Seattle", state: "Washington", documents: [ { type: "W9", status: "Approved", expires: "07/22/2026", uploadedBy: "Admin", uploadDate: "02/07/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "02/02/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/05/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "02/07/2025" }, { type: "Background Check", status: "Approved", expires: "11/05/2026", uploadedBy: "System", uploadDate: "01/22/2025" }, ] }, // Massachusetts { name: "Boston Event Services", ein: "44-4455667", region: "East Coast", city: "Boston", state: "Massachusetts", documents: [ { type: "W9", status: "Approved", expires: "09/08/2026", uploadedBy: "System", uploadDate: "02/08/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "02/03/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/06/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "02/08/2025" }, { type: "Background Check", status: "Approved", expires: "10/25/2026", uploadedBy: "System", uploadDate: "01/23/2025" }, ] }, { name: "New England Hospitality", ein: "55-5566778", region: "East Coast", city: "Boston", state: "Massachusetts", documents: [ { type: "W9", status: "Approved", expires: "05/14/2026", uploadedBy: "Admin", uploadDate: "02/09/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "02/04/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/07/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "02/09/2025" }, { type: "Background Check", status: "Approved", expires: "06/20/2026", uploadedBy: "System", uploadDate: "12/22/2024" }, ] }, // Georgia { name: "Atlanta Event Staffing", ein: "66-6677889", region: "South", city: "Atlanta", state: "Georgia", documents: [ { type: "W9", status: "Approved", expires: "08/18/2026", uploadedBy: "System", uploadDate: "02/10/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "02/05/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/08/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "02/10/2025" }, { type: "Background Check", status: "Approved", expires: "09/15/2026", uploadedBy: "System", uploadDate: "01/24/2025" }, ] }, { name: "Peach State Hospitality", ein: "77-7788990", region: "South", city: "Atlanta", state: "Georgia", documents: [ { type: "W9", status: "Approved", expires: "06/25/2026", uploadedBy: "Admin", uploadDate: "02/11/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "02/06/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/09/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "02/11/2025" }, { type: "Background Check", status: "Approved", expires: "08/10/2026", uploadedBy: "System", uploadDate: "01/25/2025" }, ] }, // Colorado { name: "Denver Event Solutions", ein: "88-8899001", region: "West", city: "Denver", state: "Colorado", documents: [ { type: "W9", status: "Approved", expires: "07/30/2026", uploadedBy: "System", uploadDate: "02/12/2025" }, { type: "COI", status: "Approved", expires: "12/31/2025", uploadedBy: "System", uploadDate: "02/07/2025" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/10/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "System", uploadDate: "02/12/2025" }, { type: "Background Check", status: "Approved", expires: "10/28/2026", uploadedBy: "System", uploadDate: "01/26/2025" }, ] }, { name: "Rocky Mountain Staffing", ein: "99-9900112", region: "West", city: "Denver", state: "Colorado", documents: [ { type: "W9", status: "Approved", expires: "04/10/2026", uploadedBy: "Admin", uploadDate: "02/13/2025" }, { type: "COI", status: "Expiring Soon", expires: "12/05/2025", uploadedBy: "System", uploadDate: "12/05/2024" }, { type: "NDA", status: "Approved", expires: "12/31/2026", uploadedBy: "Admin", uploadDate: "02/11/2025" }, { type: "Contract", status: "Approved", expires: "12/31/2025", uploadedBy: "Admin", uploadDate: "01/01/2025" }, { type: "Banking Info", status: "Approved", expires: "-", uploadedBy: "Admin", uploadDate: "02/13/2025" }, { type: "Background Check", status: "Approved", expires: "07/05/2026", uploadedBy: "System", uploadDate: "12/28/2024" }, ] }, ]; // Get top 5 vendors sorted by fill rate const topVendors = [...vendors] .sort((a, b) => b.fillRate - a.fillRate) .slice(0, 5); const { data: events } = useQuery({ queryKey: ['events'], queryFn: () => base44.entities.Event.list(), initialData: [], }); const totalSpend = 2300000; const fillRate = 97; const vendorScore = "A+"; const compliance = 98; // Derive unique filter options for the new filters const uniqueRegions = [...new Set(vendors.map(v => v.region))]; const uniqueSpecialties = [...new Set(vendors.map(v => v.specialty))]; const uniqueStates = [...new Set(vendors.map(v => v.state))]; // Derive unique filter options for onboarding suppliers const uniqueSupplierRegions = [...new Set(onboardingSuppliers.map(s => s.region))]; const uniqueSupplierCities = [...new Set(onboardingSuppliers.map(s => s.city))]; const uniqueSupplierStates = [...new Set(onboardingSuppliers.map(s => s.state))]; const uniqueDocumentTypes = [...new Set(onboardingSuppliers.flatMap(s => s.documents.map(d => d.type)))]; // Apply filters to vendors const filteredVendors = vendors.filter(vendor => { const matchesSearch = !vendorSearch || vendor.name.toLowerCase().includes(vendorSearch.toLowerCase()) || vendor.specialty.toLowerCase().includes(vendorSearch.toLowerCase()); const matchesRegion = vendorRegionFilter === "all" || vendor.region === vendorRegionFilter; const matchesSpecialty = vendorSpecialtyFilter === "all" || vendor.specialty === vendorSpecialtyFilter; const matchesState = vendorStateFilter === "all" || vendor.state === vendorStateFilter; const matchesSoftware = vendorSoftwareFilter === "all" || vendor.softwareType === vendorSoftwareFilter; return matchesSearch && matchesRegion && matchesSpecialty && matchesState && matchesSoftware; }); // Apply filters to onboarding suppliers const filteredOnboardingSuppliers = onboardingSuppliers.filter(supplier => { // Search filter const matchesSearch = !supplierSearch || supplier.name.toLowerCase().includes(supplierSearch.toLowerCase()) || supplier.ein.includes(supplierSearch); // Location filters const matchesRegion = supplierRegionFilter === "all" || supplier.region === supplierRegionFilter; const matchesCity = supplierCityFilter === "all" || supplier.city === supplierCityFilter; const matchesState = supplierStateFilter === "all" || supplier.state === supplierStateFilter; // FIXED: Combined status and document filter // When both are active, find documents that match BOTH criteria let matchesStatusAndDocument = true; if (supplierStatusFilter !== "all" || supplierDocumentFilter !== "all") { matchesStatusAndDocument = supplier.documents.some(doc => { const matchesStatus = supplierStatusFilter === "all" || doc.status === supplierStatusFilter; const matchesDocument = supplierDocumentFilter === "all" || doc.type === supplierDocumentFilter; return matchesStatus && matchesDocument; }); } return matchesSearch && matchesRegion && matchesCity && matchesState && matchesStatusAndDocument; }); // Recalculate summary counts for onboarding tab based on filtered suppliers const fullyCompliantCount = filteredOnboardingSuppliers.filter(s => s.documents.every(d => d.status === "Approved")).length; const pendingReviewCount = filteredOnboardingSuppliers.filter(s => s.documents.some(d => d.status === "Expiring Soon" || d.status === "Pending") && s.documents.every(d => d.status !== "Missing")).length; const actionRequiredCount = filteredOnboardingSuppliers.filter(s => s.documents.some(d => d.status === "Missing")).length; // Pagination logic for vendors const totalPages = Math.ceil(filteredVendors.length / itemsPerPage); const startIndex = (currentPage - 1) * itemsPerPage; const endIndex = startIndex + itemsPerPage; const paginatedVendors = filteredVendors.slice(startIndex, endIndex); // Reset to page 1 when filters change useEffect(() => { setCurrentPage(1); }, [vendorSearch, vendorRegionFilter, vendorSpecialtyFilter, vendorStateFilter, vendorSoftwareFilter, itemsPerPage]); const handleVendorClick = (vendor) => { setSelectedVendorForDetail(vendor); setShowVendorDetail(true); }; const handleEditVendor = (vendor) => { setShowVendorDetail(false); // Add actual edit functionality here, e.g., open an edit form console.log("Edit vendor:", vendor.name); // Example: Router.push(`/admin/vendors/edit/${vendor.id}`); }; return (
{/* Key Metrics */}
{/* Main Tabs */}
Overview Supplier Onboarding Contracts & Rates Purchase Orders Invoice Matching Spend Analytics Audit Trail Compliance & Documents Vendor Scorecards Trends & SLA Reports & Analytics Forecasting
{/* Overview Tab */}
{/* Vendor Efficiency Scorecard */} Vendor Efficiency Scorecard

Top 5 vendors by performance • Hover for details • Click to view full profile

{topVendors.map((vendor, idx) => ( handleVendorClick(vendor)} > ))}
Vendor Fill % On-time % CSAT Spend
{vendor.name} = 95 ? 'text-green-600' : vendor.fillRate >= 90 ? 'text-blue-600' : 'text-amber-600' }`}> {vendor.fillRate}% = 95 ? 'text-green-600' : vendor.onTimeRate >= 90 ? 'text-blue-600' : 'text-amber-600' }`}> {vendor.onTimeRate}% {vendor.csat} {vendor.spend}

Top Performer: {topVendors[0]?.name} with {topVendors[0]?.fillRate}% fill rate

{/* Spend vs Outcome */} Spend vs Outcome

Cost efficiency analysis

{topVendors.slice(0, 3).map((vendor, idx) => (
{vendor.name}
{vendor.fillRate}% Reliability
= 95 ? 'bg-gradient-to-r from-green-500 to-green-600' : vendor.fillRate >= 90 ? 'bg-gradient-to-r from-blue-500 to-blue-600' : 'bg-gradient-to-r from-amber-500 to-amber-600' }`} style={{ width: `${vendor.fillRate}%` }} />

Spend: {vendor.spend}

))} {/* Compliance Snapshot */}
Compliance Snapshot

Audit readiness across controls

Auto-sync

COI

100% valid

Background Checks

100% valid

Alcohol Training

Expiring soon

ServSafe

100% valid
{/* Supplier Onboarding & Risk Management Tab */}
{/* Left Side: Supplier Table */}
Supplier Onboarding & Risk Management

Collects vendor W-9s, COIs, banking, background-check attestations

{/* Summary Cards */}

Fully Compliant

{fullyCompliantCount}

All documents valid

Pending Review

{pendingReviewCount}

Awaiting approval or expiring soon

Action Required

{actionRequiredCount}

Missing documents

{/* Search and Filters */}
setSupplierSearch(e.target.value)} className="pl-10 h-11 border-slate-300" />
{(supplierSearch || supplierRegionFilter !== "all" || supplierCityFilter !== "all" || supplierStateFilter !== "all" || supplierStatusFilter !== "all" || supplierDocumentFilter !== "all") && (
Active filters: {supplierSearch && ( Search: {supplierSearch} )} {supplierRegionFilter !== "all" && ( Region: {supplierRegionFilter} )} {supplierStateFilter !== "all" && ( State: {supplierStateFilter} )} {supplierCityFilter !== "all" && ( City: {supplierCityFilter} )} {supplierStatusFilter !== "all" && ( Status: {supplierStatusFilter} )} {supplierDocumentFilter !== "all" && ( Document: {supplierDocumentFilter} )}
)}
{/* Suppliers Table */}
{filteredOnboardingSuppliers.length > 0 ? ( filteredOnboardingSuppliers.map((supplier, idx) => { const totalDocs = supplier.documents.length; const approvedDocs = supplier.documents.filter(d => d.status === "Approved").length; const expiringDocs = supplier.documents.filter(d => d.status === "Expiring Soon").length; const missingDocs = supplier.documents.filter(d => d.status === "Missing" || d.status === "Pending").length; const compliancePercentage = totalDocs > 0 ? Math.round((approvedDocs / totalDocs) * 100) : 0; const overallStatus = missingDocs > 0 ? "Action Required" : expiringDocs > 0 ? "Expiring Soon" : "Fully Compliant"; return ( setSelectedSupplier(supplier)} className="border-b border-slate-100 hover:bg-blue-50 transition-colors cursor-pointer" > ); }) ) : ( )}
Supplier EIN Region State Documents Compliance Action
{supplier.name} {supplier.ein} {supplier.region} {supplier.state}
{approvedDocs}/{totalDocs} Complete
{overallStatus} {compliancePercentage}%

No suppliers found

Try adjusting your search or filters

Pain Point Solved

✓ Ensures legal & insurance compliance across all vendors

✓ Centralizes all vendor documentation in one place

{/* Right Side: Detail Panel */} {selectedSupplier && (
{selectedSupplier.name}

{selectedSupplier.region} • {selectedSupplier.city}

{/* Supplier Details */}
EIN: {selectedSupplier.ein}
State: {selectedSupplier.state}
Region: {selectedSupplier.region}
Location: {selectedSupplier.city}
{/* All Documents List */}

All Documents ({selectedSupplier.documents.length})

{selectedSupplier.documents.map((doc, idx) => (
{doc.type}
{doc.status}
Uploaded: {doc.uploadDate}
By: {doc.uploadedBy}
{doc.expires !== "-" && (
Expires: {doc.expires}
)}
{(doc.status !== "Missing" && doc.status !== "Pending") && (
)} {(doc.status === "Missing" || doc.status === "Pending") && ( )}
))}
{/* Risk Rating */}

Compliance Health

d.status === "Approved").length === selectedSupplier.documents.length ? "bg-green-100 text-green-700 text-lg font-bold px-4 py-1" : selectedSupplier.documents.filter(d => d.status === "Missing" || d.status === "Pending").length > 0 ? "bg-red-100 text-red-700 text-lg font-bold px-4 py-1" : "bg-amber-100 text-amber-700 text-lg font-bold px-4 py-1" }> {selectedSupplier.documents.filter(d => d.status === "Approved").length === selectedSupplier.documents.length ? "Excellent" : selectedSupplier.documents.filter(d => d.status === "Missing" || d.status === "Pending").length > 0 ? "Action Required" : "Good"} {selectedSupplier.documents.length > 0 ? Math.round((selectedSupplier.documents.filter(d => d.status === "Approved").length / selectedSupplier.documents.length) * 100) : 0}%
d.status === "Approved").length === selectedSupplier.documents.length ? "bg-gradient-to-r from-green-500 to-green-600" : selectedSupplier.documents.filter(d => d.status === "Missing" || d.status === "Pending").length > 0 ? "bg-gradient-to-r from-red-500 to-red-600" : "bg-gradient-to-r from-amber-500 to-amber-600" }`} style={{ width: `${selectedSupplier.documents.length > 0 ? Math.round((selectedSupplier.documents.filter(d => d.status === "Approved").length / selectedSupplier.documents.length) * 100) : 0}%` }} />

Documents Complete: {selectedSupplier.documents.filter(d => d.status === "Approved").length}/{selectedSupplier.documents.length}

Expiring Soon: {selectedSupplier.documents.filter(d => d.status === "Expiring Soon").length}

Missing/Pending: {selectedSupplier.documents.filter(d => d.status === "Missing" || d.status === "Pending").length}

{/* Action Buttons */}
{selectedSupplier.documents.some(d => d.status === "Missing" || d.status === "Pending") && ( )}
)}
{/* Contract Repository & Rate Controls Tab */}
Contract Repository & Rate Controls

Stores agreements, rate cards, and ensures invoice matches rate

Active Contracts

11

Across all vendors

Rate Cards

11

Up to date

Expiring Soon

2

Within 60 days

{[ { vendor: "Legendary Event Staffing", type: "Master Service Agreement", start: "01/01/2024", end: "12/31/2025", rate: "Active", status: "Active" }, { vendor: "Instawork", type: "Platform Agreement", start: "03/15/2024", end: "03/14/2026", rate: "Active", status: "Active" }, { vendor: "NorCal Staffing", type: "Service Agreement", start: "06/01/2024", end: "05/31/2025", rate: "Active", status: "Expiring Soon" }, ].map((contract, idx) => ( ))}
Vendor Contract Type Start Date End Date Rate Card Status Actions
{contract.vendor} {contract.type} {contract.start} {contract.end} {contract.rate} {contract.status}

Pain Point Solved

✓ Prevents overbilling and non-approved pricing

✓ Ensures all invoices match agreed-upon rates

{/* Purchase Orders & Approvals Tab */}
Purchase Orders (POs) & Approvals

Issues and tracks approved orders from Compass units

Total POs

156

This month

Approved

142

91% approval rate

Pending

12

Awaiting approval

Rejected

2

Requires revision

{[ { po: "PO-2025-0234", vendor: "Legendary Event Staffing", event: "Google Holiday Party", amount: "$12,450", status: "Approved", created: "01/15/2025" }, { po: "PO-2025-0235", vendor: "Instawork", event: "Samsung Tech Summit", amount: "$8,200", status: "Approved", created: "01/15/2025" }, { po: "PO-2025-0236", vendor: "NorCal Staffing", event: "Nvidia Conference", amount: "$15,600", status: "Pending", created: "01/16/2025" }, ].map((po, idx) => ( ))}
PO Number Vendor Event Amount Status Created Actions
{po.po} {po.vendor} {po.event} {po.amount} {po.status} {po.created}

Pain Point Solved

✓ Keeps spend pre-approved before payment

✓ Tracks all orders from Compass units in one place

{/* Invoice Matching (3-way match) Tab */}
Invoice Matching (3-way match)

Matches PO → Invoice → Receipt

Perfect Match

138

All 3 documents match

Variance

4

Minor discrepancies

Failed Match

0

Requires investigation

Recent Invoice Matches

{[ { invoice: "INV-2025-0234", po: "PO-2025-0234", vendor: "Legendary Event Staffing", amount: "$12,450", status: "Matched", variance: "$0.00" }, { invoice: "INV-2025-0235", po: "PO-2025-0235", vendor: "Instawork", amount: "$8,200", status: "Matched", variance: "$0.00" }, { invoice: "INV-2025-0236", vendor: "NorCal Staffing", amount: "$15,675", status: "Variance", variance: "+$75.00" }, ].map((item, idx) => (

{item.invoice}

PO: {item.po} • {item.vendor}

{item.status}

Invoice Amount

{item.amount}

Variance

{item.variance}

))}

Pain Point Solved

✓ Prevents payment errors and fraud

✓ Automated matching saves hours of manual work

{/* Spend Analytics & Budgeting Tab */}
Spend Analytics & Budgeting

Dashboards by vendor, region, and category

Total Spend

$2.3M

YTD 2025

Budget Used

78%

$2.2M remaining

Top Vendor

Legendary

$580K spend

Cost Savings

$180K

vs last year

Spend by Vendor

{[ { vendor: "Legendary Event Staffing", amount: "$580K", percentage: 25 }, { vendor: "Instawork", amount: "$420K", percentage: 18 }, { vendor: "HSS", amount: "$380K", percentage: 17 }, { vendor: "Bluecrew", amount: "$340K", percentage: 15 }, { vendor: "Others", amount: "$580K", percentage: 25 }, ].map((item, idx) => (
{item.vendor} {item.amount}
))}

Spend by Region

{[ { region: "Bay Area", amount: "$920K", percentage: 40 }, { region: "Northern California", amount: "$690K", percentage: 30 }, { region: "National", amount: "$460K", percentage: 20 }, { region: "Multi-Region", amount: "$230K", percentage: 10 }, ].map((item, idx) => (
{item.region} {item.amount}
))}

Pain Point Solved

✓ Helps procurement see trends and negotiate better rates

✓ Real-time visibility into spending across all categories

{/* Audit Trail & Reporting Tab */}
Audit Trail & Reporting

Central log for all compliance docs and rate changes

Total Events

1,234

Last 30 days

Document Changes

45

Updates logged

Rate Changes

8

This month

Recent Activity

{[ { action: "Rate Card Updated", vendor: "Legendary Event Staffing", user: "John Smith", date: "01/16/2025 10:30 AM", type: "rate" }, { action: "W-9 Uploaded", vendor: "Instawork", user: "Sarah Johnson", date: "01/16/2025 09:15 AM", type: "document" }, { action: "Contract Renewed", vendor: "NorCal Staffing", user: "Mike Davis", date: "01/15/2025 03:45 PM", type: "contract" }, { action: "COI Updated", vendor: "HSS", user: "Emily Brown", date: "01/15/2025 02:20 PM", type: "document" }, { action: "Rate Change Approved", vendor: "Bluecrew", user: "John Smith", date: "01/15/2025 11:30 AM", type: "rate" }, ].map((activity, idx) => (
{activity.type === "rate" ? : activity.type === "document" ? : }

{activity.action}

{activity.vendor} • by {activity.user}

{activity.date}

))}

Pain Point Solved

✓ Supports Compass / Foodbuy audits with complete documentation

✓ Full transparency and traceability of all changes

{/* Compliance & Documents Tab */}
{/* Document Management */} Document Center {[ { name: "COI (Certificate of Insurance)", status: "Valid", color: "green", action: () => setShowCOIViewer(true) }, { name: "W9 Forms", status: "Valid", color: "green", action: () => setShowW9Form(true) }, { name: "Contracts", status: "Active", color: "blue", action: null }, { name: "ESG Certification", status: "Valid", color: "green", action: null }, { name: "Policies", status: "Updated", color: "blue", action: null }, { name: "Forms & Templates", status: "Available", color: "gray", action: null }, ].map((doc, idx) => (

{doc.name}

Last updated: 2 days ago

{doc.status}
))}
{/* Audit & Reporting Center */}
Audit & Reporting Center

Audit readiness across controls

Auto-sync

Compliance Status

Overall Compliance 98%
Documents Valid 156/158
Expiring Soon 2

Recent Audits

Q4 2024 Compliance Audit Passed
Vendor Verification In Progress
{/* Vendor Scorecards Tab */} {/* Vendor List */}
Vendor Directory

Showing {startIndex + 1}-{Math.min(endIndex, filteredVendors.length)} of {filteredVendors.length} vendors {filteredVendors.length !== vendors.length && ` (filtered from ${vendors.length} total)`}

{/* Search and Filters */}
{/* Search Bar */}
setVendorSearch(e.target.value)} className="pl-10 h-11 border-slate-300" />
{/* Filters Row */}
{/* Active Filters Display */} {(vendorSearch || vendorRegionFilter !== "all" || vendorSpecialtyFilter !== "all" || vendorStateFilter !== "all" || vendorSoftwareFilter !== "all") && (
Active filters: {vendorSearch && ( Search: {vendorSearch} )} {vendorRegionFilter !== "all" && ( Region: {vendorRegionFilter} )} {vendorStateFilter !== "all" && ( State: {vendorStateFilter} )} {vendorSpecialtyFilter !== "all" && ( Specialty: {vendorSpecialtyFilter} )} {vendorSoftwareFilter !== "all" && ( Software: {vendorSoftwareFilter === "platform" ? "Full Platform" : vendorSoftwareFilter === "building" ? "Building Platform" : vendorSoftwareFilter === "partial" ? "Partial Tech" : "Traditional"} )}
)}
{/* Table */}
{paginatedVendors.length > 0 ? ( paginatedVendors.map((vendor, idx) => ( )) ) : ( )}
Vendor Name Region State Specialty Total Staff Software/Platform Actions
{vendor.region} {vendor.state} {vendor.specialty}
{vendor.employees.toLocaleString()}
{vendor.softwareType === "platform" && ( ✅ {vendor.software} )} {vendor.softwareType === "building" && ( ⚙️ {vendor.software} )} {vendor.softwareType === "partial" && ( ⚙️ {vendor.software} )} {vendor.softwareType === "traditional" && ( ❌ {vendor.software} )}
e.stopPropagation()}>

No vendors found

Try adjusting your search or filters

{/* Pagination */} {totalPages > 1 && (
Page {currentPage} of {totalPages}
{/* Page Numbers */}
{Array.from({ length: Math.min(5, totalPages) }, (_, i) => { let pageNum; if (totalPages <= 5) { pageNum = i + 1; } else if (currentPage <= 3) { pageNum = i + 1; } else if (currentPage >= totalPages - 2) { pageNum = totalPages - 4 + i; } else { pageNum = currentPage - 2 + i; } return ( ); })}
)}
{/* Vendor Scorecards Table */} Vendor Scorecards - Comprehensive Rating

Rating agencies and suppliers on multiple performance metrics

Vendor Reliability Compliance Performance Pricing Service Level Client Satisfaction Billing Accuracy Wages Vendor Fee % Allowance Fee Overall Score
Legendary 98% 100% 4.7/5 $23/hr 97% 4.8/5 99.5% $18.50 19.6% $2.00 A+
Competitor B 95% 98% 4.2/5 $21/hr 94% 4.5/5 98% $17.00 19.0% $1.50 A
Competitor A 91% 96% 3.9/5 $26/hr 90% 4.0/5 95% $19.50 25.0% $2.50 B+
{/* Trends & SLA Tab */}
{/* Staffing Rate Evolution */} Evolution of Staffing Rates
Q1 2024 $21.50/hr
Q2 2024 $22.00/hr
Q3 2024 $22.75/hr
Q4 2024 $23.50/hr

+9.3% increase year-over-year

{/* SLA Compliance */} SLA Compliance Metrics
{[ { name: "I9", compliance: 100, color: "green" }, { name: "BGC", compliance: 98, color: "green" }, { name: "SOW", compliance: 95, color: "green" }, { name: "RBS", compliance: 92, color: "amber" }, { name: "DS", compliance: 97, color: "green" }, ].map((item, idx) => (
{item.name} {item.compliance}%
))}
{/* Reports & Analytics Tab */} Customized Reporting
{/* Forecasting Tab */}
Labor Demand & Cost Prediction

By season and client

Q1 2025 Forecast

Predicted Demand

2,400 shifts

Estimated Cost

$620K

Peak Period

Jan 15-31

Confidence

87%

By Client

Google
950 shifts ↑ 15%
Nvidia
720 shifts ↑ 8%
Samsung
580 shifts → 2%
Scenario Simulations

Vendor consolidation & renegotiation analysis

Scenario 1: Consolidate to Top 2 Vendors

Best ROI

Projected Savings

$180K/year

Risk Level

Medium

Reduce vendor management overhead by 40%

Scenario 2: Renegotiate All Contracts

High Impact

Projected Savings

$240K/year

Risk Level

Low

Leverage current market rates and volume discounts

Scenario 3: Build Internal Pool

Long-term

Projected Savings

$420K/year

Risk Level

High

12-18 month implementation timeline required

{/* Vendor Detail Modal */} setShowVendorDetail(false)} onEdit={handleEditVendor} /> {/* COI Viewer Dialog */} Certificate of Insurance (COI) setShowCOIViewer(false)} /> {/* W9 Form Dialog */} W-9 Form - Request for Taxpayer Identification Number setShowW9Form(false)} />
); }