diff --git a/frontend/src/pages/VisitorManagementPage.tsx b/frontend/src/pages/VisitorManagementPage.tsx index ebddf80..98800cb 100644 --- a/frontend/src/pages/VisitorManagementPage.tsx +++ b/frontend/src/pages/VisitorManagementPage.tsx @@ -56,6 +56,19 @@ export default function VisitorManagementPage() { return `${hours}h ${minutes % 60}m`; }; + const [revokeModal, setRevokeModal] = useState<{ visitor: ActiveVisitor, notes: string } | null>(null); + + const handleRevoke = async () => { + if (!revokeModal) return; + try { + await visitorsApi.revoke(revokeModal.visitor.visitorId, revokeModal.notes); + setRevokeModal(null); + loadData(); + } catch (error) { + console.error('Failed to revoke access:', error); + } + }; + const typeColors: Record = { VISITOR: 'bg-blue-500/20 text-blue-400', CONTRACTOR: 'bg-amber-500/20 text-amber-400', @@ -72,9 +85,9 @@ export default function VisitorManagementPage() {

- Visitor Management + Visitor Panopticon

-

Track and manage facility visitors

+

Real-time facility access monitoring

- {tab === 'active' ? 'On-Site' : tab} + {tab === 'active' ? 'Live View' : tab} ))}
@@ -175,27 +188,36 @@ export default function VisitorManagementPage() {
-
+
Badge
{visitor.badgeNumber}
-
+
Duration
{formatDuration(visitor.entryTime)}
{visitor.escort && ( -
+
Escort
{visitor.escort.name}
)} - +
+ + +
))} @@ -215,7 +237,7 @@ export default function VisitorManagementPage() { value={searchQuery} onChange={e => setSearchQuery(e.target.value)} onKeyDown={e => e.key === 'Enter' && loadData()} - placeholder="Search visitors..." + placeholder="Search all records..." className="w-full bg-slate-800 border border-slate-700 rounded-lg pl-10 pr-4 py-2 text-white placeholder:text-slate-500 focus:border-emerald-500 outline-none" />
@@ -265,6 +287,8 @@ export default function VisitorManagementPage() { {visitor.logs[0]?.status === 'CHECKED_IN' ? ( On-Site + ) : visitor.logs[0]?.status === 'REVOKED' ? ( + REVOKED ) : ( Off-Site )} @@ -368,6 +392,49 @@ export default function VisitorManagementPage() {
)} + + {/* Revoke Modal */} + {revokeModal && ( +
+
+
+ +

Revoke Access

+
+ +

+ Are you sure you want to immediately revoke access for {revokeModal.visitor.name}? + This will invalidate their digital badge and flag them in the system. +

+ +
+ +