Files

133 lines
5.1 KiB
TypeScript

import {
Star,
ShieldCheck,
Activity,
Clock,
BarChart2,
Plus,
} from "lucide-react";
import Button from "@/components/common/button";
import StatCard from "@/components/common/dashStatCard";
import InfoBanner from "@/components/common/infoBanner";
import Table from "@/components/common/dataTable";
import { teamStatusRows, teamStatusHeaders, vendorPerformanceHeaders, vendorPerformanceRows } from "@/constants/tabledata";
export default function VendorServicePortal() {
return (
<div className="my-15 text-slate-100 font-sans">
{/* --- HEADER SECTION --- */}
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6">
<div>
<div className="flex items-center gap-2 text-[12px] font-bold tracking-widest text-slate-500 uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span className='text-gray-600'></span>
<span className='text-gray-400'>Operations</span>
<span className='text-gray-600'></span>
<span className='text-gray-400'>Vendors</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
Vendor & field service
</h1>
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
Vendor performance scorecards and live field-crew status in one view SLA adherence, response times and job dispatch across your service partners.
</p>
</div>
{/* --- HEADER BUTTONS --- */}
<div className="flex items-center gap-3 self-start md:mt-10">
<Button className="bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 text-xs px-4 py-2 rounded-lg flex items-center gap-2 font-semibold transition-colors">
<BarChart2 className="w-4 h-4 text-slate-300" />
<span>SLA report</span>
</Button>
<Button className="bg-teal-400 hover:bg-teal-300 text-slate-950 font-bold text-xs px-4 py-2 rounded-lg flex items-center gap-2 transition-colors">
<Plus className="w-4 h-4 stroke-[3]" />
<span>Dispatch job</span>
</Button>
</div>
</div>
{/* --- STAT CARDS --- */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
{/* Active vendors */}
<StatCard
variant="icon"
title="Active vendors"
value="6"
icon={Star}
badgeText="contracted"
badgeClassName="text-slate-400 lowercase font-mono"
iconContainerClassName="bg-cyan-950/40 border-cyan-800/30 text-cyan-400"
/>
{/* Avg SLA adherence */}
<StatCard
variant="icon"
title="Avg SLA adherence"
value="93%"
icon={ShieldCheck}
badgeText="this month"
badgeClassName="text-teal-400 lowercase font-mono font-medium"
iconContainerClassName="bg-emerald-950/60 border-emerald-800/40 text-emerald-400"
/>
{/* Open field jobs */}
<StatCard
variant="icon"
title="Open field jobs"
value="12"
icon={Activity}
badgeText="in progress"
badgeClassName="text-cyan-400 lowercase font-mono"
iconContainerClassName="bg-blue-950/50 border-blue-800/30 text-blue-400"
/>
{/* Avg response time */}
<StatCard
variant="icon"
title="Avg response time"
value="2.7h"
icon={Clock}
badgeText="to site"
badgeClassName="text-slate-400 lowercase font-mono"
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-500"
/>
</div>
{/* --- TABLES GRID (SIDE-BY-SIDE) --- */}
<div className="grid grid-cols-1 xl:grid-cols-3 gap-6 items-start">
{/* LEFT TABLE: VENDOR SCORECARD */}
<div className="xl:col-span-2 border border-slate-800/80 rounded-lg overflow-hidden">
<div className="flex items-center justify-between px-6 py-4 border-b border-slate-800/80">
<h2 className="text-base font-semibold text-white">Vendor scorecard</h2>
</div>
<Table headers={vendorPerformanceHeaders} rows={vendorPerformanceRows} />
</div>
{/* RIGHT TABLE: FIELD CREW • LIVE */}
<div className=" border border-slate-800/80 rounded-lg overflow-hidden">
<div className="flex items-center justify-between px-6 py-4 border-b border-slate-800/80">
<h2 className="text-base font-semibold text-white">Field crew live</h2>
</div>
<Table headers={teamStatusHeaders} rows={teamStatusRows} />
</div>
</div>
<div className="mb-10 mt-10">
<InfoBanner
boldText="Closes the loop:"
normalText="a breached SLA or new request dispatches a field job to the right crew, tracks response-to-site time, and feeds completion back into the vendor scorecard — the vendor-facing half of the help desk."
/>
</div>
</div>
);
}