Project structure changes ad new files added in dashboard folders

This commit is contained in:
2026-07-23 18:32:07 +05:30
parent 1993d91319
commit 5a2ae769d8
63 changed files with 1550 additions and 190 deletions

View File

@@ -0,0 +1,237 @@
import {
Package,
AlertTriangle,
Activity,
FileText,
LayoutGrid,
Plus
} from "lucide-react";
import Button from "@/components/common/button";
import StatCard from "@/components/common/dashStatCard";
export default function EnergyPortal() {
const metersList = [
{
meter: "MTR-1",
name: "Electricity main 1",
location: "Pump room",
type: "Electricity",
mf: "1",
},
{
meter: "MTR-2",
name: "Water main 2",
location: "Main LT panel",
type: "Water",
mf: "10",
},
{
meter: "MTR-3",
name: "Diesel main 3",
location: "DG room",
type: "Diesel",
mf: "100",
},
{
meter: "MTR-4",
name: "Electricity main 4",
location: "Block riser",
type: "Electricity",
mf: "1",
},
{
meter: "MTR-5",
name: "Water main 5",
location: "DG room",
type: "Water",
mf: "1",
},
];
const latestReadings = [
{
meter: "MTR-1",
prev: "40.00",
current: "58.00",
cons: "18.0",
uom: "kWh",
},
{
meter: "MTR-2",
prev: "49.00",
current: "69.00",
cons: "200.0",
uom: "kL",
},
{
meter: "MTR-3",
prev: "58.00",
current: "80.00",
cons: "2200.0",
uom: "L",
},
{
meter: "MTR-4",
prev: "67.00",
current: "91.00",
cons: "24.0",
uom: "kWh",
},
{
meter: "MTR-5",
prev: "76.00",
current: "102.00",
cons: "26.0",
uom: "kL",
},
];
return (
<div className="text-slate-100 mt-15 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-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span></span>
<span>Operations</span>
<span></span>
<span>Energy</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
Meters & readings
</h1>
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
Meter master with QR identification and reading capture. Consumption is reading
× multiplication factor.
</p>
</div>
{/* --- HEADER BUTTONS --- */}
<div className="flex items-center gap-2 self-start md:mt-10">
<Button className="bg-slate-800/80 hover:bg-slate-800 text-white border border-slate-700/60 text-xs px-3 py-2 rounded-md flex items-center gap-2 font-medium">
Print QR
</Button>
<Button className="bg-teal-400 hover:bg-teal-500 text-slate-950 font-semibold text-xs px-3 py-2 rounded-md transition-colors">
Add reading
</Button>
</div>
</div>
{/* --- TABLES GRID (SIDE-BY-SIDE) --- */}
<div className="grid grid-cols-1 xl:grid-cols-2 gap-2 items-start">
{/* LEFT TABLE: METER MASTER */}
<div className="bg-[#0b1329] border border-slate-800/80 rounded-lg overflow-hidden">
<div className="flex items-center justify-between px-3 py-2 border-b border-slate-800/80">
<h2 className="text-base font-semibold text-white">Meter master</h2>
<span className="text-xs font-mono text-slate-500">5 meters</span>
</div>
<div className="">
<table className="w-full h-full text-left text-sm">
<thead>
<tr className="border-b border-slate-800/60 text-[11px] font-bold uppercase tracking-wider text-slate-400">
<th className="py-3 px-4">Meter</th>
<th className="py-3 px-4">Name</th>
<th className="py-3 px-4">Location</th>
<th className="py-3 px-4">Type</th>
<th className="py-3 px-4">MF</th>
<th className="py-3 px-4 text-right"></th>
</tr>
</thead>
<tbody className="divide-y divide-slate-800/40">
{metersList.map((row, index) => {
return (
<tr
key={index}
className="transition-colors hover:bg-slate-800/30"
>
<td className="py-3 px-4 font-mono text-teal-400 font-semibold text-xs whitespace-nowrap">
{row.meter}
</td>
<td className="py-3 px-4 font-semibold text-slate-100 whitespace-nowrap">
{row.name}
</td>
<td className="py-3 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.location}
</td>
<td className="py-3 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.type}
</td>
<td className="py-3 px-4 font-semibold text-slate-200 whitespace-nowrap">
{row.mf}
</td>
<td className="py-3 px-4 text-right">
<div className="flex items-center justify-end gap-1.5">
<button className="px-2.5 py-1 text-xs font-medium text-slate-300 bg-slate-800/50 hover:bg-slate-800 border border-slate-700/50 rounded transition-colors">
Reading
</button>
<button className="px-2.5 py-1 text-xs font-medium text-slate-300 bg-slate-800/50 hover:bg-slate-800 border border-slate-700/50 rounded transition-colors">
QR
</button>
</div>
</td>
</tr>
);
})}
</tbody>
</table>
</div>
</div>
{/* RIGHT TABLE: LATEST READINGS */}
<div className="bg-[#0b1329] 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">Latest readings</h2>
<span className="text-xs font-mono text-slate-500 lowercase">
tap a meter for history
</span>
</div>
<div>
<table className="w-full h-full text-left text-sm">
<thead>
<tr className="border-b border-slate-800/60 text-[11px] font-bold uppercase tracking-wider text-slate-400">
<th className="py-3 px-4">Meter</th>
<th className="py-3 px-4">Prev</th>
<th className="py-3 px-4">Current</th>
<th className="py-3 px-4">Cons.</th>
<th className="py-3 px-4">UOM</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-800/40">
{latestReadings.map((row, index) => (
<tr key={index} className="hover:bg-slate-800/30 transition-colors">
<td className="py-3 px-4 font-mono text-teal-400 font-medium text-xs whitespace-nowrap">
{row.meter}
</td>
<td className="py-3 px-4 text-slate-300 text-xs font-medium whitespace-nowrap">
{row.prev}
</td>
<td className="py-3 px-4 text-slate-300 text-xs font-medium whitespace-nowrap">
{row.current}
</td>
<td className="py-3 px-4 font-semibold text-teal-400 text-xs whitespace-nowrap">
{row.cons}
</td>
<td className="py-3 px-4 font-semibold text-slate-100 text-xs whitespace-nowrap">
{row.uom}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,305 @@
import {
Pencil,
FileText,
QrCode,
Search,
Plus,
AlertTriangle,
Clock,
ShieldCheck,
Target,
Download,
LayoutGrid,
} from "lucide-react";
import Table from "@/components/common/dataTable";
import InfoBanner from "@/components/common/infoBanner";
import Button from "@/components/common/button";
import NavigationTabs from "@/components/common/tabs";
import { equipmentTabs } from "@/constants/constant";
import { useState } from "react";
import StatCard from "@/components/common/dashStatCard";
const headers = [
"Code",
"Equipment",
"Group",
"Block · Floor",
"Service Provider",
"Criticality",
"PPM Status",
"Actions",
];
const Badge = ({
text,
color,
}: {
text: string;
color: string;
}) => (
<span
className={`inline-flex items-center rounded-full px-3 py-1 text-[10px] font-bold uppercase tracking-wider ${color}`}
>
<span className="mr-1.5 h-1.5 w-1.5 rounded-full bg-current"></span>
{text}
</span>
);
const ActionButtons = () => (
<div className="flex justify-center gap-1.5">
<button className="rounded-md border border-slate-700/60 p-1.5 text-slate-400 hover:text-white hover:bg-slate-800 transition">
<FileText size={14} />
</button>
<button className="rounded-md border border-slate-700/60 p-1.5 text-slate-400 hover:text-white hover:bg-slate-800 transition">
<Pencil size={14} />
</button>
<button className="rounded-md border border-slate-700/60 p-1.5 text-slate-400 hover:text-white hover:bg-slate-800 transition">
<LayoutGrid size={14} />
</button>
</div>
);
export default function EquipmentPortal() {
const [activeTab, setActiveTab] = useState<string>("Site-Wise Equipment");
const rows = [
[
<span className="font-semibold text-teal-400">APP-1100</span>,
<span className="font-bold text-slate-100">Cooling Tower</span>,
"Electrical",
"Block 1 · 2",
"Blue Star",
"Important",
<Badge text="Working" color="bg-amber-950/60 text-amber-400 border border-amber-800/30" />,
<ActionButtons />,
],
[
<span className="font-semibold text-teal-400">APP-1103</span>,
<span className="font-bold text-slate-100">Air Handling Unit</span>,
"Plumbing",
"Tower A · 1",
"Blue Star",
<Badge text="Critical" color="bg-rose-950/60 text-rose-400 border border-rose-800/30" />,
<Badge text="Completed" color="bg-emerald-950/60 text-emerald-400 border border-emerald-800/30" />,
<ActionButtons />,
],
[
<span className="font-semibold text-teal-400">APP-1106</span>,
<span className="font-bold text-slate-100">VRV Outdoor</span>,
"Electrical",
"Tower A · G",
"Voltas",
<Badge text="Critical" color="bg-rose-950/60 text-rose-400 border border-rose-800/30" />,
<Badge text="Completed" color="bg-emerald-950/60 text-emerald-400 border border-emerald-800/30" />,
<ActionButtons />,
],
[
<span className="font-semibold text-teal-400">APP-1109</span>,
<span className="font-bold text-slate-100">VRV Outdoor</span>,
"HVAC",
"Tower A · 1",
"Voltas",
"Normal",
<Badge text="Overdue" color="bg-rose-950/60 text-rose-400 border border-rose-800/30" />,
<ActionButtons />,
],
[
<span className="font-semibold text-teal-400">APP-1112</span>,
<span className="font-bold text-slate-100">Air Handling Unit</span>,
"HVAC",
"Tower A · G",
"In-house",
<Badge text="Critical" color="bg-rose-950/60 text-rose-400 border border-rose-800/30" />,
<Badge text="Completed" color="bg-emerald-950/60 text-emerald-400 border border-emerald-800/30" />,
<ActionButtons />,
],
[
<span className="font-semibold text-teal-400">APP-1115</span>,
<span className="font-bold text-slate-100">Air Handling Unit</span>,
"Electrical",
"Tower A · 2",
"Voltas",
<Badge text="Critical" color="bg-rose-950/60 text-rose-400 border border-rose-800/30" />,
<Badge text="Completed" color="bg-emerald-950/60 text-emerald-400 border border-emerald-800/30" />,
<ActionButtons />,
],
[
<span className="font-semibold text-teal-400">APP-1118</span>,
<span className="font-bold text-slate-100">Chiller</span>,
"Electrical",
"Block 1 · 1",
"In-house",
"Important",
<Badge text="Overdue" color="bg-rose-950/60 text-rose-400 border border-rose-800/30" />,
<ActionButtons />,
],
[
<span className="font-semibold text-teal-400">APP-1121</span>,
<span className="font-bold text-slate-100">Cooling Tower</span>,
"Plumbing",
"Tower A · 1",
"Blue Star",
"Normal",
<Badge text="Completed" color="bg-emerald-950/60 text-emerald-400 border border-emerald-800/30" />,
<ActionButtons />,
],
];
return (
<div className="my-15 text-slate-100 font-sans ">
<div className="flex items-center gap-2 text-[10px]
font-bold tracking-widest text-slate-500 uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span></span>
<span>Operations</span>
<span></span>
<span>Equipment</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
Equipment & maintenance
</h1>
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl mb-10 leading-relaxed">
Asset register, preventive (PPM) and
contract (AMC) maintenance, scoped to the active tenant.
</p>
{/* Navigation Tabs */}
<NavigationTabs
tabs={equipmentTabs}
activeTab={activeTab}
onTabChange={setActiveTab}
className="mb-6"
/>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
{/* Total equipment */}
<StatCard
variant="icon"
title="Total equipment"
value="8"
icon={Target}
badgeText="4 groups"
badgeClassName="text-slate-400 font-mono"
iconContainerClassName="bg-teal-950/60 border-teal-800/40 text-teal-400"
/>
{/* Critical assets */}
<StatCard
variant="icon"
title="Critical assets"
value="4"
icon={AlertTriangle}
badgeText="priority"
badgeClassName="text-rose-400 font-semibold font-mono"
iconContainerClassName="bg-rose-950/50 border-rose-800/40 text-rose-400"
/>
{/* PPM attention */}
<StatCard
variant="icon"
title="PPM attention"
value="3"
icon={Clock}
badgeText="due / overdue"
badgeClassName="text-amber-400 font-semibold font-mono"
iconContainerClassName="bg-amber-950/50 border-amber-800/40 text-amber-400"
/>
{/* On plan */}
<StatCard
variant="icon"
title="On plan"
value="5"
icon={ShieldCheck}
badgeText="healthy"
badgeClassName="text-emerald-400 font-semibold font-mono"
iconContainerClassName="bg-emerald-950/50 border-emerald-800/40 text-emerald-400"
/>
</div>
{/* --- ROW 2: SEARCH, FILTERS & ACTION BUTTONS --- */}
<div className="flex flex-col md:flex-row items-center justify-between gap-3 mb-6">
{/* Search & Group Dropdown */}
<div className="flex flex-1 flex-wrap items-center gap-3 w-full md:w-auto">
{/* Search Bar */}
<div className="relative flex-1 min-w-[260px] max-w-md">
<Search size={16} className="absolute left-3 top-1/2 -translate-y-1/2 text-slate-400" />
<input
type="text"
placeholder="Search code, name, block, provider..."
className="w-full bg-[#0b1727] border border-slate-800 rounded-lg pl-9 pr-4 py-2 text-xs text-slate-200 placeholder-slate-500 focus:outline-none focus:border-teal-500/50 transition-colors"
/>
</div>
{/* All groups dropdown */}
<select className="bg-[#0b1727] border-2 border-teal-500/80 rounded-xl px-4 py-1.5 text-xs font-semibold text-slate-200 cursor-pointer focus:outline-none transition-all">
<option value="all">All groups</option>
<option value="hvac">HVAC</option>
<option value="plumbing">Plumbing</option>
<option value="electrical">Electrical</option>
<option value="fire">Fire</option>
</select>
</div>
{/* Action Buttons Right Side */}
<div className="flex items-center gap-2 w-full md:w-auto justify-end flex-wrap">
{/* All QR */}
<Button className="flex items-center gap-1.5 bg-[#0b1727] hover:bg-slate-800/80 text-slate-200 border border-slate-800 rounded-lg px-3.5 py-2 text-xs font-semibold transition-colors">
<QrCode size={14} />
<span>All QR</span>
</Button>
{/* Download */}
<Button className="flex items-center gap-1.5 bg-[#0b1727] hover:bg-slate-800/80 text-slate-200 border border-slate-800 rounded-lg px-3.5 py-2 text-xs font-semibold transition-colors">
<Download size={14} />
<span>Download</span>
</Button>
{/* Bulk upload */}
<Button className="flex items-center gap-1.5 bg-[#0b1727] hover:bg-slate-800/80 text-slate-200 border border-slate-800 rounded-lg px-3.5 py-2 text-xs font-semibold transition-colors">
<LayoutGrid size={14} />
<span>Bulk upload</span>
</Button>
{/* Add equipment */}
<Button className="flex items-center gap-1.5 bg-teal-400 hover:bg-teal-300 text-slate-950 font-bold rounded-lg px-4 py-2 text-xs transition-colors">
<Plus size={16} className="stroke-[3]" />
<span>Add equipment</span>
</Button>
</div>
</div>
{/* Data Table */}
<div className="mt-4">
<Table headers={headers} rows={rows} />
</div>
{/* Info Banner */}
<div className="my-8">
<InfoBanner
boldText="Tip:"
normalText="click any asset to open its record — Manufacture, PPM, AMC, Request, QR, Attachment, and History Card. Use Bulk upload to import hundreds of assets from Excel/CSV, auto-linked to site, block, floor & group."
/>
</div>
</div>
);
}

View File

@@ -0,0 +1,432 @@
import { useState } from 'react';
import {
Layers,
ShieldCheck,
CheckSquare,
Clock,
Search,
QrCode,
Power,
List,
Pencil,
Plus,
} from 'lucide-react';
import Button from "@/components/common/button";
import StatCard from "@/components/common/dashStatCard";
import Table from "@/components/common/dataTable";
import NavigationTabs from '@/components/common/tabs';
import { helpdeskTtabs } from '@/constants/constant';
const StatusBadge = ({
text,
color,
}: {
text: string;
color: string;
}) => (
<span
className={`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider whitespace-nowrap ${color}`}
>
<span className="h-1.5 w-1.5 rounded-full bg-current" />
{text}
</span>
);
const ActionButtons = ({ active }: { active: boolean }) => (
<div className="flex justify-center items-center gap-1">
<Button className="flex h-7 w-7 items-center justify-center rounded-md border border-slate-700/60 text-slate-400 hover:bg-slate-800 hover:text-white transition">
<Pencil size={13} />
</Button>
<Button className="flex h-7 w-7 items-center justify-center rounded-md border border-slate-700/60 text-slate-400 hover:bg-slate-800 hover:text-white transition">
<List size={13} />
</Button>
<Button className="flex h-7 w-7 items-center justify-center rounded-md border border-slate-700/60 text-slate-400 hover:bg-slate-800 hover:text-white transition">
<ShieldCheck size={13} />
</Button>
<Button className="flex h-7 w-7 items-center justify-center rounded-md border border-slate-700/60 text-slate-400 hover:bg-slate-800 hover:text-white transition">
<QrCode size={13} />
</Button>
<Button
className={`flex h-7 w-7 items-center justify-center rounded-md border border-slate-700/60 hover:bg-slate-800 transition ${
active ? "text-red-400" : "text-emerald-400"
}`}
>
<Power size={13} />
</Button>
</div>
);
const headers = [
"",
"Block",
"Floor",
"Zone",
"Department",
"Location",
"Window",
"TAT",
"Sched.",
"Approval",
"Status",
"Actions",
];
const checkbox = (
<input
type="checkbox"
className="h-4 w-4 appearance-none rounded border border-slate-600 bg-slate-700 checked:bg-slate-500 checked:border-slate-500 cursor-pointer"
/>
);
const rows = [
[
checkbox,
"Block 2",
"1",
"Z2",
"HVAC",
<span className="font-semibold text-slate-100 whitespace-nowrap">Parking P1</span>,
<span className="font-mono text-xs whitespace-nowrap">01:5618:00</span>,
"60m",
"4",
<span className="text-emerald-400 font-semibold whitespace-nowrap"> Yes</span>,
<StatusBadge
text="Inactive"
color="bg-slate-700/50 text-slate-400"
/>,
<ActionButtons active={false} />,
],
[
checkbox,
"Block 1",
"2",
"Z1",
"Inspection work",
<span className="font-semibold text-slate-100 whitespace-nowrap">Cafeteria</span>,
<span className="font-mono text-xs whitespace-nowrap">01:5623:59</span>,
"360m",
"6",
<span className="text-slate-500"></span>,
<StatusBadge
text="Active"
color="bg-emerald-500/15 text-emerald-400"
/>,
<ActionButtons active />,
],
[
checkbox,
"Block 2",
"G",
"N",
"Inspection work",
<span className="font-semibold text-slate-100 whitespace-nowrap">Main lobby</span>,
<span className="font-mono text-xs whitespace-nowrap">08:0023:59</span>,
"360m",
"4",
<span className="text-emerald-400 font-semibold whitespace-nowrap"> Yes</span>,
<StatusBadge
text="Active"
color="bg-emerald-500/15 text-emerald-400"
/>,
<ActionButtons active />,
],
[
checkbox,
"Block 1",
"2",
"Z2",
"Electrical",
<span className="font-semibold text-slate-100 whitespace-nowrap">Reception</span>,
<span className="font-mono text-xs whitespace-nowrap">08:0018:00</span>,
"360m",
"4",
<span className="text-slate-500"></span>,
<StatusBadge
text="Inactive"
color="bg-slate-700/50 text-slate-400"
/>,
<ActionButtons active={false} />,
],
[
checkbox,
"Block 2",
"3",
"Z1",
"Housekeeping",
<span className="font-semibold text-slate-100 whitespace-nowrap">Cafeteria</span>,
<span className="font-mono text-xs whitespace-nowrap">08:0018:00</span>,
"20m",
"8",
<span className="text-emerald-400 font-semibold whitespace-nowrap"> Yes</span>,
<StatusBadge
text="Active"
color="bg-emerald-500/15 text-emerald-400"
/>,
<ActionButtons active />,
],
[
checkbox,
"Block 1",
"3",
"Z1",
"Electrical",
<span className="font-semibold text-slate-100 whitespace-nowrap">Food court</span>,
<span className="font-mono text-xs whitespace-nowrap">08:0017:30</span>,
"20m",
"8",
<span className="text-slate-500"></span>,
<StatusBadge
text="Active"
color="bg-emerald-500/15 text-emerald-400"
/>,
<ActionButtons active />,
],
[
checkbox,
"Block 2",
"1",
"Z2",
"HVAC",
<span className="font-semibold text-slate-100 whitespace-nowrap">Parking P1</span>,
<span className="font-mono text-xs whitespace-nowrap">01:5618:00</span>,
"60m",
"4",
<span className="text-emerald-400 font-semibold whitespace-nowrap"> Yes</span>,
<StatusBadge
text="Inactive"
color="bg-slate-700/50 text-slate-400"
/>,
<ActionButtons active={false} />,
],
[
checkbox,
"Block 1",
"2",
"Z1",
"Inspection work",
<span className="font-semibold text-slate-100 whitespace-nowrap">Cafeteria</span>,
<span className="font-mono text-xs whitespace-nowrap">01:5623:59</span>,
"360m",
"6",
<span className="text-slate-500"></span>,
<StatusBadge
text="Active"
color="bg-emerald-500/15 text-emerald-400"
/>,
<ActionButtons active />,
],
[
checkbox,
"Block 2",
"G",
"N",
"Inspection work",
<span className="font-semibold text-slate-100 whitespace-nowrap">Main lobby</span>,
<span className="font-mono text-xs whitespace-nowrap">08:0023:59</span>,
"360m",
"4",
<span className="text-emerald-400 font-semibold whitespace-nowrap"> Yes</span>,
<StatusBadge
text="Active"
color="bg-emerald-500/15 text-emerald-400"
/>,
<ActionButtons active />,
],
[
checkbox,
"Block 1",
"2",
"Z2",
"Electrical",
<span className="font-semibold text-slate-100 whitespace-nowrap">Reception</span>,
<span className="font-mono text-xs whitespace-nowrap">08:0018:00</span>,
"360m",
"4",
<span className="text-slate-500"></span>,
<StatusBadge
text="Inactive"
color="bg-slate-700/50 text-slate-400"
/>,
<ActionButtons active={false} />,
],
[
checkbox,
"Block 2",
"3",
"Z1",
"Housekeeping",
<span className="font-semibold text-slate-100 whitespace-nowrap">Cafeteria</span>,
<span className="font-mono text-xs whitespace-nowrap">08:0018:00</span>,
"20m",
"8",
<span className="text-emerald-400 font-semibold whitespace-nowrap"> Yes</span>,
<StatusBadge
text="Active"
color="bg-emerald-500/15 text-emerald-400"
/>,
<ActionButtons active />,
],
[
checkbox,
"Block 1",
"3",
"Z1",
"Electrical",
<span className="font-semibold text-slate-100 whitespace-nowrap">Food court</span>,
<span className="font-mono text-xs whitespace-nowrap">08:0017:30</span>,
"20m",
"8",
<span className="text-slate-500"></span>,
<StatusBadge
text="Active"
color="bg-emerald-500/15 text-emerald-400"
/>,
<ActionButtons active />,
],
];
export default function HelpDeskPortal() {
const [activeTab, setActiveTab] = useState<string>('Location');
return (
<div className="my-15 px-4 text-slate-100 font-sans">
{/* --- HEADER SECTION --- */}
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-3 mb-4">
<div>
<div className="flex items-center gap-2 text-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span></span>
<span>Operations</span>
<span></span>
<span>Help Desk</span>
</div>
<h1 className="text-2xl font-extrabold text-white tracking-tight mt-1.5">
Help Desk & checklists
</h1>
<p className="text-sm font-medium text-slate-400 mt-1 max-w-xl leading-relaxed">
Scheduled location and equipment inspections, missed-checklist recovery, and HSQE incident management.
</p>
</div>
</div>
<div>
{/* Reusable Navigation Tabs */}
<NavigationTabs
tabs={helpdeskTtabs}
activeTab={activeTab}
onTabChange={setActiveTab}
className="mb-4"
/>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 mb-4">
{/* Total Checklists */}
<StatCard
variant="icon"
title="Total checklists"
value="10"
icon={Layers}
badgeText="Location set"
badgeClassName="text-slate-500 lowercase font-mono"
iconContainerClassName="bg-slate-800/60 border-slate-700/50 text-slate-300"
/>
{/* Active */}
<StatCard
variant="icon"
title="Active"
value="7"
icon={ShieldCheck}
badgeText="of 10"
badgeClassName="text-teal-400 font-mono font-medium"
iconContainerClassName="bg-emerald-950/60 border-emerald-800/40 text-emerald-400"
/>
{/* Approval Set */}
<StatCard
variant="icon"
title="Approval set"
value="5"
icon={CheckSquare}
badgeText="workflow"
badgeClassName="text-slate-500 lowercase font-mono"
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-500"
/>
{/* Avg TAT */}
<StatCard
variant="icon"
title="Avg TAT"
value="40m"
icon={Clock}
badgeText="target"
badgeClassName="text-slate-500 lowercase font-mono"
iconContainerClassName="bg-blue-950/50 border-blue-800/30 text-blue-400"
/>
</div>
{/* --- ROW 2: SEARCH, FILTERS & ACTION BUTTONS --- */}
<div className="flex flex-col md:flex-row items-center justify-between gap-3 mb-4">
{/* Search & Select Filters */}
<div className="flex flex-1 flex-wrap items-center gap-2.5 w-full md:w-auto">
{/* Search Bar */}
<div className="relative flex-1 min-w-[200px] max-w-md">
<Search size={16} className="absolute left-3 top-1/2 -translate-y-1/2 text-slate-400" />
<input
type="text"
placeholder="Search location, block, department..."
className="w-full bg-[#0b1727] border border-slate-800 rounded-lg pl-9 pr-3 py-1.5 text-xs text-slate-200 placeholder-slate-500 focus:outline-none focus:border-teal-500/50 transition-colors"
/>
</div>
{/* Block Dropdown */}
<select className="bg-[#081321] border border-slate-800/80 rounded-lg px-3 py-1.5 text-xs font-semibold text-slate-200 cursor-pointer focus:outline-none focus:ring-2 focus:ring-[#2dd4bf] focus:ring-offset-2 focus:ring-offset-[#081321] transition-all">
<option value="all">All blocks</option>
<option value="block 1">Block 1</option>
<option value="block 2">Block 2</option>
</select>
{/* Status Dropdown */}
<select className="bg-[#081321] border border-transparent ring-2 ring-[#2dd4bf] ring-offset-2 ring-offset-[#081321] rounded-lg px-3 py-1.5 text-xs font-semibold text-slate-200 cursor-pointer focus:outline-none transition-all">
<option value="all">All status</option>
<option value="active">Active</option>
<option value="inactive">InActive</option>
</select>
</div>
{/* Action Buttons */}
<div className="flex items-center gap-2 w-full md:w-auto justify-end">
<Button className="flex items-center gap-1.5 bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 rounded-lg px-3 py-1.5 text-xs font-semibold transition-colors">
<QrCode size={14} />
<span>All QR</span>
</Button>
<Button className="flex items-center gap-1.5 bg-teal-400 hover:bg-teal-300 text-slate-950 font-bold rounded-lg px-3.5 py-1.5 text-xs transition-colors">
<Plus size={15} className="stroke-[3]" />
<span>New Location Checklist</span>
</Button>
</div>
</div>
{/* --- TABLE CONTAINER --- */}
<div className="mt-4 overflow-x-auto">
<Table headers={headers} rows={rows} />
</div>
</div>
);
}

View File

@@ -0,0 +1,456 @@
import {
Package,
AlertTriangle,
Activity,
FileText,
LayoutGrid,
Plus
} from "lucide-react";
import Button from "@/components/common/button";
import StatCard from "@/components/common/dashStatCard";
import InfoBanner from "@/components/common/infoBanner";
export default function InventoryPortal() {
const stockItems = [
{
item: "Cooling tower fan belt",
group: "HVAC",
store: "Block Store",
min: 5,
presentValue: 8,
unit: "Gallon",
status: "COMPLETED",
isHighlighted: false,
},
{
item: "Air filter 24×24",
group: "HVAC",
store: "Block Store",
min: 5,
presentValue: 2,
unit: "Nos",
status: "OVERDUE",
isHighlighted: true,
},
{
item: "MCB 32A",
group: "Electrical",
store: "Block Store",
min: 5,
presentValue: 8,
unit: "Nos",
status: "COMPLETED",
isHighlighted: false,
},
{
item: "Contactor 40A",
group: "Electrical",
store: "Block Store",
min: 2,
presentValue: 2,
unit: "Nos",
status: "OVERDUE",
isHighlighted: false,
},
{
item: "PVC pipe 1\"",
group: "Plumbing",
store: "Main Store",
min: 3,
presentValue: 0,
unit: "Mtr",
status: "OVERDUE",
isHighlighted: false,
},
{
item: "Submersible pump seal",
group: "Plumbing",
store: "Main Store",
min: 3,
presentValue: 2,
unit: "Nos",
status: "OVERDUE",
isHighlighted: false,
},
{
item: "Refrigerant R410a",
group: "HVAC",
store: "Block Store",
min: 5,
presentValue: 0,
unit: "Kg",
status: "OVERDUE",
isHighlighted: false,
},
];
const consumptionLedger = [
{
txn: "TXN-5200",
item: "Cooling tower fan belt",
type: "Consume",
qty: "2 Gallon",
jobCard: "026/1009",
date: "Jun 20, 2026",
},
{
txn: "TXN-5201",
item: "MCB 32A",
type: "Consume",
qty: "1 Nos",
jobCard: "026/1016",
date: "Jun 21, 2026",
},
{
txn: "TXN-5202",
item: "Air filter 24×24",
type: "Receipt",
qty: "10 Nos",
jobCard: "—",
date: "Jun 22, 2026",
},
{
txn: "TXN-5203",
item: "Submersible pump seal",
type: "Consume",
qty: "1 Nos",
jobCard: "026/1023",
date: "Jun 23, 2026",
},
{
txn: "TXN-5204",
item: "Air filter 24×24",
type: "Consume",
qty: "3 Nos",
jobCard: "026/1030",
date: "Jun 24, 2026",
},
{
txn: "TXN-5205",
item: "PVC pipe 1\"",
type: "Receipt",
qty: "20 Mtr",
jobCard: "—",
date: "Jun 25, 2026",
},
{
txn: "TXN-5406",
item: "Cooling tower fan belt",
type: "Consume",
qty: "2 Gallon",
jobCard: "026/1009",
date: "Jun 7, 2026",
},
{
txn: "TXN-5407",
item: "MCB 32A",
type: "Consume",
qty: "1 Nos",
jobCard: "026/1016",
date: "Jun 7, 2026",
},
{
txn: "TXN-5200",
item: "Cooling tower fan belt",
type: "Consume",
qty: "2 Gallon",
jobCard: "026/1009",
date: "Jun 20, 2026",
},
{
txn: "TXN-5201",
item: "MCB 32A",
type: "Consume",
qty: "1 Nos",
jobCard: "026/1016",
date: "Jun 21, 2026",
},
{
txn: "TXN-5202",
item: "Air filter 24×24",
type: "Receipt",
qty: "10 Nos",
jobCard: "—",
date: "Jun 22, 2026",
},
{
txn: "TXN-5203",
item: "Submersible pump seal",
type: "Consume",
qty: "1 Nos",
jobCard: "026/1023",
date: "Jun 23, 2026",
},
{
txn: "TXN-5204",
item: "Air filter 24×24",
type: "Consume",
qty: "3 Nos",
jobCard: "026/1030",
date: "Jun 24, 2026",
},
{
txn: "TXN-5205",
item: "PVC pipe 1\"",
type: "Receipt",
qty: "20 Mtr",
jobCard: "—",
date: "Jun 25, 2026",
},
{
txn: "TXN-5406",
item: "Cooling tower fan belt",
type: "Consume",
qty: "2 Gallon",
jobCard: "026/1009",
date: "Jun 7, 2026",
},
{
txn: "TXN-5407",
item: "MCB 32A",
type: "Consume",
qty: "1 Nos",
jobCard: "026/1016",
date: "Jun 7, 2026",
},
];
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-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span></span>
<span>Operations</span>
<span></span>
<span>Inventory</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
Inventory & stock
</h1>
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
Stock master with receipt / consume transactions. Consumption posts back to the
originating request job card; items at or below minimum are flagged for reorder.
</p>
</div>
{/* --- HEADER BUTTONS --- */}
<div className="flex items-center gap-2 self-start md:mt-10">
<Button className="bg-slate-800/80 hover:bg-slate-800 text-white border border-slate-700/60 text-xs px-3 py-2 rounded-md flex items-center gap-2 font-medium">
<LayoutGrid className="w-4 h-4 text-slate-400" />
Bulk upload
</Button>
<Button className="bg-slate-800/80 hover:bg-slate-800 text-white border border-slate-700/60 text-xs px-3 py-2 rounded-md flex items-center gap-2 font-medium">
<Plus className="w-4 h-4 text-slate-400" />
Add item
</Button>
<Button className="bg-teal-400 hover:bg-teal-500 text-slate-950 font-semibold text-xs px-3 py-2 rounded-md transition-colors">
Receive stock
</Button>
</div>
</div>
{/* --- STAT CARDS --- */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
{/* Stock items */}
<StatCard
variant="icon"
title="Stock items"
value="7"
icon={Package}
badgeText="tracked"
badgeClassName="text-slate-400 lowercase font-mono"
iconContainerClassName="bg-blue-950/40 border-blue-800/30 text-blue-400"
/>
{/* Below minimum */}
<StatCard
variant="icon"
title="Below minimum"
value="5"
icon={AlertTriangle}
badgeText="reorder"
badgeClassName="text-rose-400 lowercase font-mono"
iconContainerClassName="bg-rose-950/40 border-rose-800/30 text-rose-400"
/>
{/* Units consumed */}
<StatCard
variant="icon"
title="Units consumed"
value="17"
icon={Activity}
badgeText="this month"
badgeClassName="text-slate-400 lowercase font-mono"
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-400"
/>
{/* Posted to requests */}
<StatCard
variant="icon"
title="Posted to requests"
value="10"
icon={FileText}
badgeText="linked"
badgeClassName="text-emerald-400 lowercase font-mono"
iconContainerClassName="bg-emerald-950/40 border-emerald-800/30 text-emerald-400"
/>
</div>
{/* --- TABLES GRID (SIDE-BY-SIDE) --- */}
<div className="grid grid-cols-1 xl:grid-cols-2 gap-6 items-start">
{/* LEFT TABLE: STOCK MASTER */}
<div className="bg-[#0b1329] 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">Stock master</h2>
<span className="text-xs font-mono text-slate-500">7 items</span>
</div>
{/* Corrected column layout and removed horizontal scrollbar to align with the right UI. */}
<div className="">
<table className="w-full h-full text-left text-sm">
<thead>
<tr className="border-b border-slate-800/60 text-[11px] font-bold uppercase tracking-wider text-slate-400">
<th className="py-3 px-4">Item</th>
<th className="py-3 px-4">Group</th>
<th className="py-3 px-4">Store</th>
<th className="py-3 px-4">Min</th>
<th className="py-3 px-4">Present</th>
<th className="py-3 px-4">Status</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-800/40">
{stockItems.map((row, index) => {
const isOverdue = row.status === "OVERDUE";
return (
<tr
key={index}
className={`transition-colors relative ${
row.isHighlighted
? "bg-[#0e2238]"
: "hover:bg-slate-800/30"
}`}
>
<td className="py-3 px-4 font-semibold text-slate-100 relative">
{row.isHighlighted && (
<div className="absolute left-0 top-0 bottom-0 w-[3px] bg-teal-400" />
)}
{row.item}
</td>
<td className="py-3 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.group}
</td>
<td className="py-3 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.store}
</td>
<td className="py-3 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.min}
</td>
<td className="py-3 px-4 font-semibold whitespace-nowrap">
<span className={isOverdue ? "text-rose-400" : "text-white"}>
{row.presentValue}{" "}
</span>
<span
className={`font-mono text-xs ${
isOverdue ? "text-rose-400" : "text-slate-300"
}`}
>
{row.unit}
</span>
</td>
<td className="py-3 px-4">
{row.status === "COMPLETED" ? (
<span className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-bold tracking-wider bg-emerald-950/60 text-emerald-400 border border-emerald-800/30">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400"></span>
COMPLETED
</span>
) : (
<span className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[10px] font-bold tracking-wider bg-rose-950/40 text-rose-400 border border-rose-900/30">
<span className="w-1.5 h-1.5 rounded-full bg-rose-400"></span>
OVERDUE
</span>
)}
</td>
</tr>
);
})}
</tbody>
</table>
</div>
</div>
{/* RIGHT TABLE: CONSUMPTION LEDGER */}
<div className="bg-[#0b1329] 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">Consumption ledger</h2>
<span className="text-xs font-mono text-slate-500 lowercase">
posts back to job card
</span>
</div>
<div>
<table className="w-full h-full text-left text-sm">
<thead>
<tr className="border-b border-slate-800/60 text-[11px] font-bold uppercase tracking-wider text-slate-400">
<th className="py-3 px-4">Txn</th>
<th className="py-3 px-4">Item</th>
<th className="py-3 px-4">Type</th>
<th className="py-3 px-4">Qty</th>
<th className="py-3 px-4">Job Card</th>
<th className="py-3 px-4">Date</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-800/40">
{consumptionLedger.map((row, index) => (
<tr key={index} className="hover:bg-slate-800/30 transition-colors">
<td className="py-3 px-4 font-mono text-teal-400 font-medium text-xs whitespace-nowrap">
{row.txn}
</td>
<td className="py-3 px-4 font-semibold text-slate-100 max-w-[140px]">
{row.item}
</td>
<td className="py-3 px-4 whitespace-nowrap">
{row.type === "Consume" ? (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-950/40 text-amber-300 border border-amber-800/30">
<span className="w-1.5 h-1.5 rounded-full bg-amber-400"></span>
Consume
</span>
) : (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-950/40 text-blue-300 border border-blue-800/30">
<span className="w-1.5 h-1.5 rounded-full bg-blue-400"></span>
Receipt
</span>
)}
</td>
<td className="py-3 px-4 font-medium text-slate-200 whitespace-nowrap">
{row.qty}
</td>
<td className="py-3 px-4 font-mono text-teal-400 text-xs whitespace-nowrap">
{row.jobCard}
</td>
<td className="py-3 px-4 text-slate-300 text-xs font-medium whitespace-nowrap">
{row.date}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
<div className="mb-10 mt-10">
<InfoBanner
boldText="Post back:"
normalText="consuming a spare against a TFM request decrements stock and writes a transaction onto that request's job card (shared item, UOM and store masters) — visible in Reports → Stock Consumption and on the request history."
/>
</div>
</div>
);
}

View File

@@ -0,0 +1,259 @@
import { useState } from 'react';
import { Plus } from 'lucide-react';
import Button from "@/components/common/button";
import LocationTable from '@/components/common/dataTable';
import NavigationTabs from '@/components/common/tabs';
import { Reqeusttabs,statusFilters } from '@/constants/constant';
import FilterTabs from '@/components/common/roundedFilters';
import Table from '@/components/common/dataTable';
const StatusBadge = ({
text,
color,
}: {
text: string;
color: string;
}) => (
<span
className={`inline-flex items-center gap-1 rounded-full px-3 py-1 text-[10px] font-semibold uppercase tracking-wider whitespace-nowrap ${color}`}
>
<span className="h-1.5 w-1.5 rounded-full bg-current" />
{text}
</span>
);
const headers = [
"Request No.",
"Department",
"Issue",
"Location",
"Assignee",
"Source",
"Status",
];
const rows = [
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1009</span>,
"Electrical",
"Lighting out",
"Block 1 · G",
"ME Local",
<span className="font-mono">Line</span>,
<StatusBadge
text="Overdue"
color="bg-red-500/15 text-red-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1016</span>,
"HVAC",
"AHU not cooling",
"Lobby · 1",
"Dhananjay T.",
<span className="font-mono">Walk-in</span>,
<StatusBadge
text="Registered"
color="bg-blue-500/15 text-blue-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1023</span>,
"HVAC",
"Thermostat fault",
"Block 1 · 1",
"ME Local",
<span className="font-mono">Mobile app</span>,
<StatusBadge
text="Assigned"
color="bg-blue-500/15 text-blue-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1030</span>,
"HVAC",
"Thermostat fault",
"Block 1 · 1",
"Dhananjay T.",
<span className="font-mono">Mobile app</span>,
<StatusBadge
text="Working"
color="bg-amber-500/15 text-amber-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1037</span>,
"Civil",
"Glass break",
"Block 1 · 1",
"Local Helpdesk",
<span className="font-mono">Walk-in</span>,
<StatusBadge
text="Completed"
color="bg-emerald-500/15 text-emerald-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1044</span>,
"HVAC",
"Chiller alarm",
"Block 1 · 1",
"Dhananjay T.",
<span className="font-mono">Mobile app</span>,
<StatusBadge
text="Overdue"
color="bg-red-500/15 text-red-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1051</span>,
"Plumbing",
"Water leakage",
"Lobby · 1",
"Local Helpdesk",
<span className="font-mono">Walk-in</span>,
<StatusBadge
text="Registered"
color="bg-blue-500/15 text-blue-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1058</span>,
"Civil",
"Glass break",
"Block 2 · 2",
"Dhananjay T.",
<span className="font-mono">Walk-in</span>,
<StatusBadge
text="Assigned"
color="bg-blue-500/15 text-blue-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1065</span>,
"Civil",
"Ceiling crack",
"Lobby · G",
"ME Local",
<span className="font-mono">Line</span>,
<StatusBadge
text="Working"
color="bg-amber-500/15 text-amber-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1072</span>,
"Plumbing",
"Water leakage",
"Block 2 · G",
"TECH Local",
<span className="font-mono">Line</span>,
<StatusBadge
text="Completed"
color="bg-emerald-500/15 text-emerald-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1079</span>,
"Electrical",
"DB switch fault",
"Tower A · 1",
"TECH Local",
<span className="font-mono">Mobile app</span>,
<StatusBadge
text="Overdue"
color="bg-red-500/15 text-red-400"
/>,
],
[
<span className="font-semibold text-[#2EE6C5]">TFM/AP/2026/1086</span>,
"HVAC",
"AHU not cooling",
"Lobby · 3",
"TECH Local",
<span className="font-mono">Walk-in</span>,
<StatusBadge
text="Registered"
color="bg-blue-500/15 text-blue-400"
/>,
],
];
export default function ServiceRequestsPortal() {
const [activeTab, setActiveTab] = useState<string>('TFM Requests');
const [activeFilter, setActiveFilter] = useState<string>('All');
return (
<div className="my-15 text-slate-100 max-w-7xl mx-auto 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-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span></span>
<span>Operations</span>
<span></span>
<span>Requests</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
Service requests
</h1>
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
TFM helpdesk tickets, engineering breakdowns, and auto-generated recurring complaints one request lifecycle.
</p>
</div>
</div>
{/* --- NAVIGATION TABS & TOP ACTION BUTTONS --- */}
<div className="flex flex-col
md:flex-row md:items-center justify-between
border-b border-slate-800/80 mb-4 gap-4">
{/* Navigation Tabs */}
<NavigationTabs
tabs={Reqeusttabs}
activeTab={activeTab}
onTabChange={setActiveTab}
className="mb-6"
/>
{/* Action Buttons */}
<div className="flex items-center gap-3 pb-3 md:pb-0">
<Button className="flex items-center gap-2 bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 rounded-lg px-4 py-2 text-xs font-semibold transition-colors">
<span>Export</span>
</Button>
<Button className="flex items-center gap-2 bg-teal-400 hover:bg-teal-300 text-slate-950 font-bold rounded-lg px-4 py-2 text-xs transition-colors">
<Plus size={16} className="stroke-[3]" />
<span>New request</span>
</Button>
</div>
</div>
{/* --- STATUS PILL FILTERS --- */}
<FilterTabs
options={statusFilters}
activeFilter={activeFilter}
onChange={setActiveFilter}
/>
<div className='mt-5'>
<Table headers={headers} rows={rows}/>
</div>
</div>
);
}

View File

@@ -0,0 +1,331 @@
import { useState } from 'react';
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";
export default function VendorServicePortal() {
const vendorData = [
{
name: "Voltas Ltd",
id: "CTR-700",
scope: "HVAC AMC & breakdown",
rating: "4.6",
sla: "95%",
slaColor: "text-emerald-400",
response: "4.0h",
openJobs: "2",
},
{
name: "Blue Star",
id: "CTR-701",
scope: "Chiller & VRV service",
rating: "4.1",
sla: "88%",
slaColor: "text-amber-400",
response: "1.2h",
openJobs: "2",
},
{
name: "Sterling FM",
id: "CTR-702",
scope: "Integrated FM / soft services",
rating: "3.4",
sla: "94%",
slaColor: "text-emerald-400",
response: "2.4h",
openJobs: "4",
},
{
name: "OTIS Elevators",
id: "CTR-704",
scope: "Elevator AMC",
rating: "4.8",
sla: "95%",
slaColor: "text-emerald-400",
response: "2.8h",
openJobs: "—",
},
{
name: "Sodexo",
id: "CTR-705",
scope: "Soft services & cafeteria",
rating: "4.3",
sla: "90%",
slaColor: "text-amber-400",
response: "2.8h",
openJobs: "1",
},
{
name: "In-house team",
id: "—",
scope: "Day-to-day maintenance",
rating: "4.0",
sla: "93%",
slaColor: "text-amber-400",
response: "3.2h",
openJobs: "3",
},
];
const fieldCrewData = [
{
initials: "RK",
name: "Ravi Kumar",
role: "M&E Technician • Chiller plant",
status: "ON-SITE",
statusType: "onsite",
time: "6.4h today",
},
{
initials: "SI",
name: "Sana Iqbal",
role: "HVAC Engineer • AHU room L7",
status: "ON-SITE",
statusType: "onsite",
time: "6.1h today",
},
{
initials: "MD",
name: "Mohan D.",
role: "Electrician • En route",
status: "EN-ROUTE",
statusType: "enroute",
time: "—",
},
{
initials: "LN",
name: "Lakshmi N.",
role: "Housekeeping Lead • Lobby + L2",
status: "ON-SITE",
statusType: "onsite",
time: "6.7h today",
},
{
initials: "AP",
name: "Arjun P.",
role: "Plumber • Off-site",
status: "OFF-SITE",
statusType: "offsite",
time: "—",
},
{
initials: "FR",
name: "Fatima R.",
role: "BMS Operator • Control room",
status: "ON-SITE",
statusType: "onsite",
time: "7.6h today",
},
];
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-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span></span>
<span>Operations</span>
<span></span>
<span>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 bg-[#0b1329] 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>
<span className="text-xs font-mono text-slate-500 lowercase">
SLA rating jobs
</span>
</div>
<div className="overflow-x-auto">
<table className="w-full text-left text-sm">
<thead>
<tr className="border-b border-slate-800/60 text-[11px] font-bold uppercase tracking-wider text-slate-400">
<th className="py-3 px-6">Vendor</th>
<th className="py-3 px-4">Scope</th>
<th className="py-3 px-4">Rating</th>
<th className="py-3 px-4">SLA</th>
<th className="py-3 px-4">Response</th>
<th className="py-3 px-6">Open</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-800/40">
{vendorData.map((row, index) => (
<tr key={index} className="hover:bg-slate-800/30 transition-colors">
<td className="py-4 px-6">
<div className="font-semibold text-slate-100">{row.name}</div>
<div className="text-xs font-mono text-slate-500 mt-0.5">{row.id}</div>
</td>
<td className="py-4 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.scope}
</td>
<td className="py-4 px-4 font-medium text-slate-200 whitespace-nowrap">
<div className="flex items-center gap-1">
<span>{row.rating}</span>
<Star className="w-3.5 h-3.5 fill-amber-400 text-amber-400" />
</div>
</td>
<td className={`py-4 px-4 font-semibold whitespace-nowrap ${row.slaColor}`}>
{row.sla}
</td>
<td className="py-4 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.response}
</td>
<td className="py-4 px-6 font-semibold text-blue-400 whitespace-nowrap">
{row.openJobs}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
{/* RIGHT TABLE: FIELD CREW • LIVE */}
<div className="bg-[#0b1329] 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>
<span className="text-xs font-mono text-slate-500 lowercase">
4 on site
</span>
</div>
<div className="p-4 space-y-3">
{fieldCrewData.map((crew, index) => {
return (
<div
key={index}
className="flex items-center justify-between p-3 rounded-lg bg-[#0d1835]/50 hover:bg-slate-800/30 transition-colors border border-slate-800/40"
>
<div className="flex items-center gap-3">
<div className="w-9 h-9 rounded-lg bg-teal-950/60 border border-teal-800/30 text-teal-400 text-xs font-bold flex items-center justify-center shrink-0">
{crew.initials}
</div>
<div>
<div className="font-semibold text-slate-100 text-sm">{crew.name}</div>
<div className="text-xs text-slate-400 mt-0.5">{crew.role}</div>
</div>
</div>
<div className="text-right shrink-0">
{crew.statusType === "onsite" && (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-emerald-950/60 text-emerald-400 border border-emerald-800/30">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400"></span>
{crew.status}
</span>
)}
{crew.statusType === "enroute" && (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-amber-950/60 text-amber-400 border border-amber-800/30">
<span className="w-1.5 h-1.5 rounded-full bg-amber-400"></span>
{crew.status}
</span>
)}
{crew.statusType === "offsite" && (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-slate-800/80 text-slate-400 border border-slate-700/50">
<span className="w-1.5 h-1.5 rounded-full bg-slate-500"></span>
{crew.status}
</span>
)}
<div className="text-[11px] font-mono text-slate-500 mt-1">
{crew.time}
</div>
</div>
</div>
);
})}
</div>
</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>
);
}

View File

@@ -0,0 +1,352 @@
import { useState } from 'react';
import { Plus, ShieldCheck, Clock, Check, AlertTriangle, QrCode, FileText, Eye } from 'lucide-react';
import Button from "@/components/common/button";
import { workPermitFilters } from '@/constants/constant';
import FilterTabs from '@/components/common/roundedFilters';
import StatCard from '@/components/common/dashStatCard';
import InfoBanner from '@/components/common/infoBanner';
export default function WorkPermitPortal() {
const [activeFilter, setActiveFilter] = useState<string>('All');
// Permit Data matching the UI
const permitsData = [
{
permit: "PTW-2663",
workingType: "Work at Height",
location: "Atrium void",
contractor: "Blue Star",
validityDate: "Jun 26, 2026",
validityTime: "08:3017:00",
crew: 2,
status: "ACTIVE",
actionText: "Close out",
isHighlighted: false,
},
{
permit: "PTW-2664",
workingType: "Electrical Isolation",
location: "STP wet well",
contractor: "Sterling FM",
validityDate: "Jun 26, 2026",
validityTime: "09:0013:00",
crew: 3,
status: "SUBMITTED",
actionText: "Approve",
isHighlighted: true, // Row with highlight bar
},
{
permit: "PTW-2665",
workingType: "Confined Space",
location: "DG yard",
contractor: "In-house team",
validityDate: "Jun 26, 2026",
validityTime: "14:0018:00",
crew: 4,
status: "APPROVED",
actionText: "Activate",
isHighlighted: false,
},
{
permit: "PTW-2666",
workingType: "Hot Work",
location: "Roof terrace",
contractor: "Voltas Ltd",
validityDate: "Jun 25, 2026",
validityTime: "08:0012:00",
crew: 5,
status: "EXPIRED",
hasViewIconOnly: true,
isHighlighted: false,
},
{
permit: "PTW-2667",
workingType: "Work at Height",
location: "LT panel room",
contractor: "Blue Star",
validityDate: "Jun 25, 2026",
validityTime: "10:0016:00",
crew: 2,
status: "CLOSED",
hasViewIconOnly: true,
isHighlighted: false,
},
{
permit: "PTW-2668",
workingType: "Electrical Isolation",
location: "Chiller plant",
contractor: "Sterling FM",
validityDate: "Jun 26, 2026",
validityTime: "11:0015:00",
crew: 3,
status: "REJECTED",
hasViewIconOnly: true,
isHighlighted: false,
},
{
permit: "PTW-2726",
workingType: "Work at Height",
location: "Atrium void",
contractor: "Blue Star",
validityDate: "Jun 26, 2026",
validityTime: "08:3017:00",
crew: 2,
status: "DRAFT",
actionText: "Submit",
isHighlighted: false,
},
];
const renderStatusBadge = (status: string) => {
switch (status) {
case "ACTIVE":
return (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-emerald-950/60 text-emerald-400 border border-emerald-800/40">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400"></span>
ACTIVE
</span>
);
case "SUBMITTED":
return (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-amber-950/50 text-amber-300 border border-amber-800/40">
<span className="w-1.5 h-1.5 rounded-full bg-amber-400"></span>
SUBMITTED
</span>
);
case "APPROVED":
return (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-blue-950/60 text-blue-400 border border-blue-800/40">
<span className="w-1.5 h-1.5 rounded-full bg-blue-400"></span>
APPROVED
</span>
);
case "EXPIRED":
return (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-rose-950/40 text-rose-400 border border-rose-900/30">
<span className="w-1.5 h-1.5 rounded-full bg-rose-400"></span>
EXPIRED
</span>
);
case "CLOSED":
return (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-slate-800/80 text-slate-400 border border-slate-700/50">
<span className="w-1.5 h-1.5 rounded-full bg-slate-400"></span>
CLOSED
</span>
);
case "REJECTED":
return (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-rose-950/40 text-rose-400 border border-rose-900/30">
<span className="w-1.5 h-1.5 rounded-full bg-rose-400"></span>
REJECTED
</span>
);
case "DRAFT":
return (
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-slate-800/80 text-slate-400 border border-slate-700/50">
<span className="w-1.5 h-1.5 rounded-full bg-slate-400"></span>
DRAFT
</span>
);
default:
return null;
}
};
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-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span></span>
<span>Operations</span>
<span></span>
<span>Work Permit</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
Permit to Work
</h1>
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
A controlled permit-to-work lifecycle request, risk review, approval, activation and close-out per site and hazard type. QR-driven on the floor.
</p>
</div>
{/* Action Buttons */}
<div className="flex items-center gap-3 self-start md:mt-10">
<Button className="flex items-center gap-2 bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 rounded-lg px-4 py-2 text-xs font-semibold transition-colors">
<QrCode size={16} />
<span>Scan QR</span>
</Button>
<Button className="flex items-center gap-2 bg-teal-400 hover:bg-teal-300 text-slate-950 font-bold rounded-lg px-4 py-2 text-xs transition-colors">
<Plus size={16} className="stroke-[3]" />
<span>New permit</span>
</Button>
</div>
</div>
{/* --- NAVIGATION TABS & TOP ACTION BUTTONS --- */}
<div className="flex flex-col md:flex-row md:items-center justify-between border-b border-slate-800/80 mb-6 gap-4">
{/* Navigation tabs component if needed */}
</div>
{/* --- STAT CARDS --- */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
{/* Active on site */}
<StatCard
variant="icon"
title="Active on site"
value="2"
icon={ShieldCheck}
badgeText="live"
badgeClassName="text-teal-400 font-mono font-medium"
iconContainerClassName="bg-emerald-950/60 border-emerald-800/40 text-emerald-400"
/>
{/* Awaiting approval */}
<StatCard
variant="icon"
title="Awaiting approval"
value="3"
icon={Clock}
badgeText="action due"
badgeClassName="text-amber-500 font-mono font-medium"
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-500"
/>
{/* Approved · ready */}
<StatCard
variant="icon"
title="Approved · ready"
value="1"
icon={Check}
badgeText="to activate"
badgeClassName="text-slate-400 font-mono"
iconContainerClassName="bg-blue-950/50 border-blue-800/30 text-blue-400"
/>
{/* Expired · breach */}
<StatCard
variant="icon"
title="Expired · breach"
value="1"
icon={AlertTriangle}
badgeText="escalate"
badgeClassName="text-rose-400 font-mono font-medium"
iconContainerClassName="bg-rose-950/50 border-rose-800/30 text-rose-400"
/>
</div>
{/* --- STATUS PILL FILTERS --- */}
<div className="mb-6">
<FilterTabs
options={workPermitFilters}
activeFilter={activeFilter}
onChange={setActiveFilter}
/>
</div>
{/* --- PERMIT TABLE SECTION --- */}
<div className="bg-[#0b1329] border border-slate-800/80 rounded-lg overflow-x-auto">
<table className="w-full text-left text-sm">
<thead>
<tr className="border-b border-slate-800/80 text-[11px] font-bold uppercase tracking-wider text-slate-400">
<th className="py-3 px-4">Permit</th>
<th className="py-3 px-4">Working Type</th>
<th className="py-3 px-4">Location</th>
<th className="py-3 px-4">Contractor</th>
<th className="py-3 px-4">Validity</th>
<th className="py-3 px-4">Crew</th>
<th className="py-3 px-4">Status</th>
<th className="py-3 px-4 text-right"></th>
</tr>
</thead>
<tbody className="divide-y divide-slate-800/40">
{permitsData.map((row, index) => (
<tr
key={index}
className={`transition-colors relative ${
row.isHighlighted ? "bg-[#0e2238]" : "hover:bg-slate-800/30"
}`}
>
{/* Permit ID */}
<td className="py-4 px-4 font-mono text-teal-400 font-medium text-xs whitespace-nowrap relative">
{row.isHighlighted && (
<div className="absolute left-0 top-0 bottom-0 w-[3px] bg-teal-400" />
)}
{row.permit}
</td>
{/* Working Type */}
<td className="py-4 px-4 font-semibold text-slate-100 whitespace-nowrap">
{row.workingType}
</td>
{/* Location */}
<td className="py-4 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.location}
</td>
{/* Contractor */}
<td className="py-4 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.contractor}
</td>
{/* Validity */}
<td className="py-4 px-4 whitespace-nowrap">
<div className="text-xs text-slate-300 font-medium">{row.validityDate}</div>
<div className="text-[11px] font-mono text-slate-500">{row.validityTime}</div>
</td>
{/* Crew */}
<td className="py-4 px-4 text-slate-300 font-medium whitespace-nowrap">
{row.crew}
</td>
{/* Status Badge */}
<td className="py-4 px-4 whitespace-nowrap">
{renderStatusBadge(row.status)}
</td>
{/* Actions */}
<td className="py-4 px-4 text-right whitespace-nowrap">
<div className="flex items-center justify-end gap-2">
{row.hasViewIconOnly ? (
<div className="flex flex-col gap-1">
<button className="p-1.5 text-slate-400 hover:text-white bg-slate-800/40 hover:bg-slate-800 rounded border border-slate-700/50 transition-colors">
<FileText size={14} />
</button>
<button className="p-1.5 text-slate-400 hover:text-white bg-slate-800/40 hover:bg-slate-800 rounded border border-slate-700/50 transition-colors">
<Eye size={14} />
</button>
</div>
) : (
<div className="flex flex-col items-center gap-1">
<button className="p-1.5 text-slate-400 hover:text-white bg-slate-800/40 hover:bg-slate-800 rounded border border-slate-700/50 transition-colors">
<FileText size={14} />
</button>
<button className="text-teal-400 hover:text-teal-300 text-xs font-semibold hover:underline">
{row.actionText}
</button>
</div>
)}
</div>
</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="mb-10 mt-10">
<InfoBanner
boldText="Compliance:"
normalText="a permit must be Approved before work starts and Closed on completion. Permits past their validity window auto-flag as Expired for safety escalation."
/>
</div>
</div>
);
}