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,179 @@
import { useState } from 'react';
import {
Calendar,
Clock,
Activity,
Check,
Plus,
Pencil,
Trash2
} from "lucide-react";
import Button from "@/components/common/button";
import StatCard from "@/components/common/dashStatCard";
import { roomData, scheduleData } from '@/constants/constant';
import { Card } from '@/components/common/cardWrapper';
import { CardHeader } from '@/components/common/cardHeader';
// Your Card Comp
export default function MeetingRoomPortal() {
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>WORKPLACE</span>
<span></span>
<span>MEETING ROOMS</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-1">
Meeting room booking
</h1>
<p className="text-sm font-medium text-slate-400 mt-1 max-w-xl leading-relaxed">
Real-time availability, calendar-synced reservations, room services and utilization analytics.
</p>
</div>
{/* --- HEADER BUTTONS --- */}
<div className="flex items-center gap-2.5 self-start md:mt-6">
<Button className="bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 text-xs px-3.5 py-2 rounded-lg flex items-center gap-2 font-semibold transition-colors">
<Calendar className="w-4 h-4 text-slate-300" />
<span>Sync calendar</span>
</Button>
<Button className="bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 text-xs px-3.5 py-2 rounded-lg flex items-center gap-2 font-semibold transition-colors">
<Plus className="w-4 h-4 text-slate-300" />
<span>Add room</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-1.5 transition-colors">
<Plus className="w-4 h-4 stroke-[3]" />
<span>Book room</span>
</Button>
</div>
</div>
{/* --- STAT CARDS --- */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
{/* Available now */}
<StatCard
variant="icon"
title="Available now"
value="3"
icon={Calendar}
badgeText="of 6 rooms"
badgeClassName="text-emerald-400 lowercase font-mono"
iconContainerClassName="bg-emerald-950/40 border-emerald-800/30 text-emerald-400"
/>
{/* In use now */}
<StatCard
variant="icon"
title="In use now"
value="2"
icon={Clock}
badgeText="live"
badgeClassName="text-rose-400 lowercase font-mono"
iconContainerClassName="bg-rose-950/40 border-rose-900/30 text-rose-400"
/>
{/* Utilization */}
<StatCard
variant="icon"
title="Utilization"
value="50%"
icon={Activity}
badgeText="today"
badgeClassName="text-slate-400 lowercase font-mono"
iconContainerClassName="bg-blue-950/50 border-blue-800/30 text-blue-400"
/>
{/* Bookings today */}
<StatCard
variant="icon"
title="Bookings today"
value="5"
icon={Check}
badgeText="scheduled"
badgeClassName="text-slate-400 lowercase font-mono"
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-500"
/>
</div>
{/* --- MAIN CONTENT UI (ADDED BELOW STAT CARDS) --- */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
{/* Room List (Left 2 Columns) */}
<div className="lg:col-span-2 grid grid-cols-1 md:grid-cols-2 gap-4">
{roomData.map((room) => (
<Card key={room.id} className="min-h-[170px]">
<div>
{/* Header info inside room card */}
<div className="flex justify-between items-start mb-1">
<div>
<h3 className="text-white font-semibold text-base">{room.name}</h3>
<p className="text-xs text-slate-400 font-mono mt-0.5">{room.location}</p>
</div>
<span className={`flex items-center gap-1.5 px-2 py-0.5 rounded text-[10px] font-mono font-bold border ${room.statusColor}`}>
<span className={`w-1.5 h-1.5 rounded-full ${room.dotColor}`} />
{room.status}
</span>
</div>
{/* Feature Tags */}
<div className="flex flex-wrap gap-1.5 my-3">
{room.tags.map((tag, idx) => (
<span key={idx} className="bg-[#12233a] border border-[#1d3554] text-slate-300 text-[11px] px-2 py-0.5 rounded">
{tag}
</span>
))}
</div>
</div>
{/* Bottom Info & Action Buttons */}
<div className="flex items-center justify-between border-t border-[#162942]/60 pt-3 mt-2">
<span className="text-xs text-slate-400">{room.subtitle}</span>
<div className="flex items-center gap-1.5">
<button className="bg-[#12233a] hover:bg-[#1a3252] border border-[#1d3554] text-slate-200 text-xs font-semibold px-3 py-1.5 rounded transition-colors">
{room.actionType === "book" ? "Book" : "View"}
</button>
<button className="bg-[#12233a] hover:bg-[#1a3252] border border-[#1d3554] text-slate-400 hover:text-slate-200 p-1.5 rounded transition-colors">
<Pencil className="w-3.5 h-3.5" />
</button>
<button className="bg-[#12233a] hover:bg-[#1a3252] border border-[#1d3554] text-slate-400 hover:text-rose-400 p-1.5 rounded transition-colors">
<Trash2 className="w-3.5 h-3.5" />
</button>
</div>
</div>
</Card>
))}
</div>
{/* Today's Schedule Timeline (Right 1 Column) */}
<div>
<Card className="h-full justify-start">
<CardHeader title="Todays schedule" subtitle="Apple One — HQ Tower" />
<div className="mt-4 space-y-6 relative before:absolute before:inset-0 before:left-[7px] before:w-[2px] before:bg-[#1d3554] pl-6">
{scheduleData.map((item, idx) => (
<div key={idx} className="relative">
{/* Timeline dot */}
<span className="absolute -left-[23px] top-1 w-3.5 h-3.5 rounded-full border-2 border-[#0a1526] bg-teal-400 ring-2 ring-teal-400/20" />
{/* Event Details */}
<h4 className="text-sm font-semibold text-white leading-tight">
{item.room} <span className="text-slate-400 font-normal"> {item.title}</span>
</h4>
<p className="text-xs text-slate-500 font-mono mt-1">
{item.time} <span className="text-slate-600"></span> {item.status}
</p>
</div>
))}
</div>
</Card>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,279 @@
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";
import FilterTabs from '@/components/common/roundedFilters';
import { visitorFilters } from '@/constants/constant';
import Table from '@/components/common/dataTable';
export default function VistiorManagementPortal() {
const headers = [
"Pass",
"Visitor",
"Company",
"Host",
"Purpose",
"Type",
"In",
"Out",
"Status",
"",
];
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 rows = [
[
<span className="font-semibold text-[#2EE6C5]">VIS-4145</span>,
<span className="font-semibold text-slate-100">Rahul Mehta</span>,
"Voltas Ltd",
"Dhananjay T.",
"Maintenance visit",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Contractor</span>,
"09:12",
"—",
<Badge text="Checked-In" color="bg-emerald-500/15 text-emerald-400" />,
<Button className="text-teal-400 font-semibold hover:text-teal-300">Check out</Button>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4146</span>,
<span className="font-semibold text-slate-100">Anita Desai</span>,
"Siemens",
"ME Local",
"Interview",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Interview</span>,
"—",
"—",
<Badge text="Expected" color="bg-blue-500/15 text-blue-400" />,
<Button className="text-emerald-400 font-semibold hover:text-emerald-300">Check in</Button>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4147</span>,
<span className="font-semibold text-slate-100">Karthik R.</span>,
"Schindler",
"Site FM Lead",
"Client meeting",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Guest</span>,
"08:05",
"10:40",
<Badge text="Checked-Out" color="bg-slate-700 text-slate-400" />,
<span className="text-slate-500"></span>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4148</span>,
<span className="font-semibold text-slate-100">Priya Nair</span>,
"Amazon Logistics",
"Estates Office",
"Material delivery",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Delivery</span>,
"—",
"—",
<Badge text="Pre-Reg" color="bg-yellow-500/15 text-yellow-400" />,
<Button className="text-emerald-400 font-semibold hover:text-emerald-300">Check in</Button>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4149</span>,
<span className="font-semibold text-slate-100">Imran Q.</span>,
"FreshMenu",
"TECH Local",
"AMC service",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Contractor</span>,
"10:30",
"—",
<Badge text="Checked-In" color="bg-emerald-500/15 text-emerald-400" />,
<Button className="text-teal-400 font-semibold hover:text-teal-300">Check out</Button>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4145</span>,
<span className="font-semibold text-slate-100">Rahul Mehta</span>,
"Voltas Ltd",
"Dhananjay T.",
"Maintenance visit",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Contractor</span>,
"09:12",
"—",
<Badge text="Checked-In" color="bg-emerald-500/15 text-emerald-400" />,
<Button className="text-teal-400 font-semibold hover:text-teal-300">Check out</Button>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4146</span>,
<span className="font-semibold text-slate-100">Anita Desai</span>,
"Siemens",
"ME Local",
"Interview",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Interview</span>,
"—",
"—",
<Badge text="Expected" color="bg-blue-500/15 text-blue-400" />,
<Button className="text-emerald-400 font-semibold hover:text-emerald-300">Check in</Button>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4147</span>,
<span className="font-semibold text-slate-100">Karthik R.</span>,
"Schindler",
"Site FM Lead",
"Client meeting",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Guest</span>,
"08:05",
"10:40",
<Badge text="Checked-Out" color="bg-slate-700 text-slate-400" />,
<span className="text-slate-500"></span>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4148</span>,
<span className="font-semibold text-slate-100">Priya Nair</span>,
"Amazon Logistics",
"Estates Office",
"Material delivery",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Delivery</span>,
"—",
"—",
<Badge text="Pre-Reg" color="bg-yellow-500/15 text-yellow-400" />,
<Button className="text-emerald-400 font-semibold hover:text-emerald-300">Check in</Button>,
],
[
<span className="font-semibold text-[#2EE6C5]">VIS-4149</span>,
<span className="font-semibold text-slate-100">Imran Q.</span>,
"FreshMenu",
"TECH Local",
"AMC service",
<span className="px-3 py-1 rounded-lg bg-slate-900 border border-slate-700 text-xs">Contractor</span>,
"10:30",
"—",
<Badge text="Checked-In" color="bg-emerald-500/15 text-emerald-400" />,
<Button className="text-teal-400 font-semibold hover:text-teal-300">Check out</Button>,
],
];
const [activeFilter, setActiveFilter] = useState<string>('All');
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>Workplace</span>
<span></span>
<span>Visitors</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
Visitor management
</h1>
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
Pre-registration, QR / OTP check-in, host notifications and on-site visitor tracking with a full audit trail.
</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>Scan QR</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>Pre Register</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>
{/* --- STATUS PILL FILTERS --- */}
<div className="mb-6">
<FilterTabs
options={visitorFilters}
activeFilter={activeFilter}
onChange={setActiveFilter}
/>
</div>
<Table headers={headers} rows={rows}/>
<div className="mb-10 mt-10">
<InfoBanner
boldText="Flow:"
normalText="host pre-registers → visitor receives QR + OTP → reception scans for check-in (ID & photo captured) → host notified → auto check-out on exit. Denied visitors are held on a site watchlist."
/>
</div>
</div>
);
}

View File

@@ -0,0 +1,218 @@
import {
Activity,
Monitor,
Clock,
ShieldCheck,
Pencil,
Trash2,
Sparkles,
Plus
} from "lucide-react";
import InfoBanner from "@/components/common/infoBanner";
import Button from "@/components/common/button";
import NavigationTabs from "@/components/common/tabs";
import { useState } from "react";
import { workspaceTabs, zoneUtilizationData } from "@/constants/constant";
import StatCard from "@/components/common/dashStatCard";
import { Card } from '@/components/common/cardWrapper';
import { CardHeader } from '@/components/common/cardHeader';
export default function WorkSpacePortal() {
const [activeTab, setActiveTab] = useState<string>("Desk Booking");
// Grid state matching the UI: 4 rows x 12 columns (48 seats)
// Types: 'occupied' (red/purple outline), 'free' (teal), 'reserved' (amber)
const deskGrid = Array.from({ length: 48 }).map((_, index) => {
if (index === 42) return "reserved"; // 1 Reserved desk
if (index >= 36) return "free"; // Free desks on the bottom row
return "occupied"; // Occupied desks
});
return (
<div className="my-15 text-slate-100 font-sans">
{/* --- HEADER SECTION WITH BUTTONS --- */}
<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>WORKPLACE</span>
<span></span>
<span>WORKSPACE</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
Workspace management
</h1>
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
Desk booking, live floor plans and shift timetable unified, all reading the Block Floor Zone master.
</p>
</div>
{/* --- ACTION BUTTONS --- */}
<div className="flex items-center gap-2.5 self-start mt-10">
<Button className="bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 text-xs px-3.5 py-2 rounded-lg flex items-center gap-2 font-semibold transition-colors">
<Sparkles className="w-4 h-4 text-slate-300" />
<span>Policies</span>
</Button>
<Button className="bg-[#0b1727] hover:bg-slate-800/60 text-slate-200 border border-slate-800 text-xs px-3.5 py-2 rounded-lg flex items-center gap-2 font-semibold transition-colors">
<Plus className="w-4 h-4 text-slate-300" />
<span>Add zone</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-1.5 transition-colors">
<Plus className="w-4 h-4 stroke-[3]" />
<span>Book desk</span>
</Button>
</div>
</div>
{/* Navigation Tabs */}
<NavigationTabs
tabs={workspaceTabs}
activeTab={activeTab}
onTabChange={setActiveTab}
className="mb-6"
/>
{/* --- STAT CARDS --- */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
{/* Total desks */}
<StatCard
variant="icon"
title="Total desks"
value="162"
icon={Monitor}
badgeText="4 zones"
badgeClassName="text-slate-400 lowercase font-mono"
iconContainerClassName="bg-blue-950/40 border-blue-800/30 text-blue-400"
/>
{/* Available */}
<StatCard
variant="icon"
title="Available"
value="39"
icon={ShieldCheck}
badgeText="free now"
badgeClassName="text-emerald-400 lowercase font-mono"
iconContainerClassName="bg-emerald-950/40 border-emerald-800/30 text-emerald-400"
/>
{/* Occupied */}
<StatCard
variant="icon"
title="Occupied"
value="123"
icon={Clock}
badgeText="checked in"
badgeClassName="text-rose-400 lowercase font-mono"
iconContainerClassName="bg-rose-950/40 border-rose-900/30 text-rose-400"
/>
{/* Utilization */}
<StatCard
variant="icon"
title="Utilization"
value="76%"
icon={Activity}
badgeText="today"
badgeClassName="text-slate-400 lowercase font-mono"
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-400"
/>
</div>
{/* --- OCCUPANCY & ZONE UTILIZATION SECTION --- */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
{/* Live Occupancy Grid (Left 2 Columns) */}
<Card className="lg:col-span-2 justify-start">
<CardHeader
title="Live occupancy · North Wing L8"
subtitle="39 / 48 occupied"
/>
{/* Desk Layout Grid */}
<div className="grid grid-cols-6 sm:grid-cols-12 gap-2 my-4">
{deskGrid.map((type, i) => (
<div
key={i}
className={`h-10 rounded-lg border transition-all ${
type === "occupied"
? "bg-[#181828]/50 border-rose-500/30"
: type === "free"
? "bg-teal-950/30 border-teal-500/50"
: "bg-slate-900/60 border-amber-500/50"
}`}
/>
))}
</div>
{/* Map Legend */}
<div className="flex items-center gap-6 mt-2 pt-2 text-xs text-slate-400">
<div className="flex items-center gap-2">
<span className="w-3 h-3 rounded border border-teal-500/50 bg-teal-950/30" />
<span>Free</span>
</div>
<div className="flex items-center gap-2">
<span className="w-3 h-3 rounded border border-amber-500/50 bg-slate-900/60" />
<span>Reserved</span>
</div>
<div className="flex items-center gap-2">
<span className="w-3 h-3 rounded border border-rose-500/30 bg-[#181828]/50" />
<span>Occupied</span>
</div>
</div>
</Card>
{/* Zone Utilization Bars (Right 1 Column) */}
<Card className="justify-start">
<CardHeader title="Zone utilization" />
<div className="space-y-5 mt-3">
{zoneUtilizationData.map((zone, idx) => {
const percentage = Math.round((zone.current / zone.max) * 100);
return (
<div key={idx} className="flex items-center justify-between gap-3">
<span className="text-xs font-medium text-slate-300 w-32 truncate">
{zone.name}
</span>
{/* Progress Bar Container */}
<div className="flex-1 bg-[#12233a] h-2 rounded-full overflow-hidden">
<div
className={`h-full ${zone.barColor} transition-all duration-300`}
style={{ width: `${percentage}%` }}
/>
</div>
{/* Value & Actions */}
<div className="flex items-center gap-2 font-mono text-xs text-slate-200">
<span className="font-bold">{zone.current}/{zone.max}</span>
<button className="bg-[#12233a] hover:bg-[#1a3252] border border-[#1d3554] text-slate-400 hover:text-slate-200 p-1 rounded transition-colors">
<Pencil className="w-3 h-3" />
</button>
<button className="bg-[#12233a] hover:bg-[#1a3252] border border-[#1d3554] text-slate-400 hover:text-rose-400 p-1 rounded transition-colors">
<Trash2 className="w-3 h-3" />
</button>
</div>
</div>
);
})}
</div>
</Card>
</div>
{/* Info Banner */}
<div className="my-8">
<InfoBanner
boldText="Policy:"
normalText="hot desks auto-release after a 15-min no-show; fixed desks are role-assigned; collaboration zones are first-come via QR check-in."
/>
</div>
</div>
);
}