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('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:30–17: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:00–13: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:00–18: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:00–12: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:00–16: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:00–15: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:30–17:00", crew: 2, status: "DRAFT", actionText: "Submit", isHighlighted: false, }, ]; const renderStatusBadge = (status: string) => { switch (status) { case "ACTIVE": return ( ACTIVE ); case "SUBMITTED": return ( SUBMITTED ); case "APPROVED": return ( APPROVED ); case "EXPIRED": return ( EXPIRED ); case "CLOSED": return ( CLOSED ); case "REJECTED": return ( REJECTED ); case "DRAFT": return ( DRAFT ); default: return null; } }; return (
{/* --- HEADER SECTION --- */}
Apple One — HQ Tower Operations Work Permit

Permit to Work

A controlled permit-to-work lifecycle — request, risk review, approval, activation and close-out — per site and hazard type. QR-driven on the floor.

{/* Action Buttons */}
{/* --- NAVIGATION TABS & TOP ACTION BUTTONS --- */}
{/* Navigation tabs component if needed */}
{/* --- STAT CARDS --- */}
{/* Active on site */} {/* Awaiting approval */} {/* Approved · ready */} {/* Expired · breach */}
{/* --- STATUS PILL FILTERS --- */}
{/* --- PERMIT TABLE SECTION --- */}
{permitsData.map((row, index) => ( {/* Permit ID */} {/* Working Type */} {/* Location */} {/* Contractor */} {/* Validity */} {/* Crew */} {/* Status Badge */} {/* Actions */} ))}
Permit Working Type Location Contractor Validity Crew Status
{row.isHighlighted && (
)} {row.permit}
{row.workingType} {row.location} {row.contractor}
{row.validityDate}
{row.validityTime}
{row.crew} {renderStatusBadge(row.status)}
{row.hasViewIconOnly ? (
) : (
)}
); }