Authentication And Serive Engineer Portal is added
This commit is contained in:
50
app/api/auth/[...nextauth]/route.ts
Normal file
50
app/api/auth/[...nextauth]/route.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
import NextAuth, { NextAuthOptions } from "next-auth";
|
||||||
|
import KeycloakProvider from "next-auth/providers/keycloak";
|
||||||
|
|
||||||
|
|
||||||
|
export const authOptions: NextAuthOptions = {
|
||||||
|
providers: [
|
||||||
|
KeycloakProvider({
|
||||||
|
clientId: process.env.KEYCLOAK_CLIENT_ID!,
|
||||||
|
clientSecret: process.env.KEYCLOAK_CLIENT_SECRET!,
|
||||||
|
issuer: process.env.KEYCLOAK_ISSUER!,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
|
||||||
|
secret: process.env.NEXTAUTH_SECRET,
|
||||||
|
callbacks: {
|
||||||
|
async jwt({ token, account, profile }) {
|
||||||
|
console.log("PROFILE =>", profile)
|
||||||
|
|
||||||
|
if (account && profile) {
|
||||||
|
token.name =
|
||||||
|
(profile as any).name ||
|
||||||
|
(profile as any).preferred_username ||
|
||||||
|
"Unknown User"
|
||||||
|
|
||||||
|
token.email = (profile as any).email || "no-email"
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("TOKEN =>", token)
|
||||||
|
return token
|
||||||
|
},
|
||||||
|
|
||||||
|
async session({ session, token }) {
|
||||||
|
session.user = {
|
||||||
|
...session.user,
|
||||||
|
name: token.name as string,
|
||||||
|
email: token.email as string,
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("SESSION =>", session)
|
||||||
|
return session
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
debug: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
const handler = NextAuth(authOptions);
|
||||||
|
|
||||||
|
export { handler as GET, handler as POST };
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import ServiceEngineerPortal from "@/components/dashboard/serviceEngineer";
|
||||||
|
|
||||||
|
export default function EngagementDashboard() {
|
||||||
|
return (
|
||||||
|
|
||||||
|
|
||||||
|
<div className="p-6">
|
||||||
|
<ServiceEngineerPortal/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,7 +1,17 @@
|
|||||||
// app/dashboard/page.tsx
|
// app/dashboard/page.tsx
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
|
import { getServerSession } from "next-auth/next";
|
||||||
|
import { authOptions } from "@/app/api/auth/[...nextauth]/route"; // Changed from handler to authOptions
|
||||||
|
|
||||||
export default function DashboardBasePage() {
|
export default async function DashboardBasePage() {
|
||||||
// Automatically redirect the user to the actual overview dashboard page
|
|
||||||
redirect("/dashboard/overview/dashboard");
|
const session = await getServerSession(authOptions);
|
||||||
|
|
||||||
|
if (!session) {
|
||||||
|
redirect("/login");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
redirect("/dashboard/overview/dashboard");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
import SessionWrapper from "./sessionWrapper";
|
||||||
|
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
@@ -12,7 +12,11 @@ export default function RootLayout({
|
|||||||
<html
|
<html
|
||||||
lang="en"
|
lang="en"
|
||||||
>
|
>
|
||||||
<body >{children}</body>
|
<body>
|
||||||
|
<SessionWrapper>
|
||||||
|
{children}
|
||||||
|
</SessionWrapper>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import OverViewDashboardPage from "./dashboard/overview/buildingOwner/page";
|
|||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<OverViewDashboardPage/>
|
{/* <OverViewDashboardPage/> */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
14
app/sessionWrapper.tsx
Normal file
14
app/sessionWrapper.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import React from "react";
|
||||||
|
import { SessionProvider } from "next-auth/react";
|
||||||
|
|
||||||
|
interface SessionWrapperProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function SessionWrapper({
|
||||||
|
children,
|
||||||
|
}: SessionWrapperProps) {
|
||||||
|
return <SessionProvider>{children}</SessionProvider>;
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import Button from "@/utils/button";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import {Props} from "@/constants/types"
|
import {Props} from "@/constants/types"
|
||||||
|
import { signIn } from "next-auth/react";
|
||||||
|
|
||||||
|
|
||||||
export default function LoginForm({ onSuccess,onForgotPassword }: Props) {
|
export default function LoginForm({ onSuccess,onForgotPassword }: Props) {
|
||||||
@@ -41,9 +42,9 @@ export default function LoginForm({ onSuccess,onForgotPassword }: Props) {
|
|||||||
<Button
|
<Button
|
||||||
|
|
||||||
onClick={() => setShowPassword(!showPassword)}
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
className="absolute right-4 top-[40px] text-slate-500 hover:text-slate-300"
|
className="absolute right-4 top-[35px] text-slate-500 hover:text-slate-300"
|
||||||
>
|
>
|
||||||
{showPassword ? <EyeOff size={18} /> : <Eye size={18} />}
|
{showPassword ? <Eye size={18} /> :<EyeOff size={18} />}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -85,6 +86,9 @@ export default function LoginForm({ onSuccess,onForgotPassword }: Props) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
onClick={() => signIn("keycloak", {
|
||||||
|
callbackUrl: "/dashboard",
|
||||||
|
})}
|
||||||
className="h-10 w-full rounded-lg border border-slate-800 bg-[#122031] text-sm font-semibold text-white hover:bg-[#17293e] transition"
|
className="h-10 w-full rounded-lg border border-slate-800 bg-[#122031] text-sm font-semibold text-white hover:bg-[#17293e] transition"
|
||||||
>
|
>
|
||||||
Sign in with SSO
|
Sign in with SSO
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ export default function VerifyCode({ onBack }: Props) {
|
|||||||
Trust this device for 30 days
|
Trust this device for 30 days
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<Button className="h-10 w-full rounded-xl bg-gradient-to-r from-teal-400 to-emerald-400 font-semibold text-black">
|
<Button
|
||||||
|
className="h-10 w-full rounded-xl bg-gradient-to-r from-teal-400 to-emerald-400 font-semibold text-black">
|
||||||
Verify & Continue
|
Verify & Continue
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
import { Building2, ShieldCheck, Database, Leaf, FileSpreadsheet } from "lucide-react";
|
||||||
import { Building2, ShieldCheck, Database, Leaf, FileSpreadsheet, Sparkles } from "lucide-react";
|
|
||||||
import StatCard from "@/utils/dashStatCard";
|
import StatCard from "@/utils/dashStatCard";
|
||||||
import { energyData } from "@/constants/constant";
|
import { energyData } from "@/constants/constant";
|
||||||
import BarChart from "@/utils/barchart";
|
import BarChart from "@/utils/barchart";
|
||||||
@@ -7,12 +6,13 @@ import InfoBanner from "@/utils/infoBanner";
|
|||||||
import Button from "@/utils/button";
|
import Button from "@/utils/button";
|
||||||
import { ProgressBarRow } from "@/utils/progressBarRow";
|
import { ProgressBarRow } from "@/utils/progressBarRow";
|
||||||
|
|
||||||
|
// Import your custom Card components
|
||||||
|
import { Card } from "@/utils/cardWrapper";
|
||||||
|
import { CardHeader } from "@/utils/cardHeader";
|
||||||
|
|
||||||
export default function BuildingOwnerPortal() {
|
export default function BuildingOwnerPortal() {
|
||||||
// Mock data matching the screenshot chart (Jan - Jun)
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-[#060d18] text-slate-100 p-6 lg:p-10 font-sans antialiased selection:bg-teal-500/30">
|
<div className="mt-20 font-sans antialiased">
|
||||||
|
|
||||||
{/* --- HEADER SECTION --- */}
|
{/* --- HEADER SECTION --- */}
|
||||||
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-8">
|
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-8">
|
||||||
@@ -47,7 +47,7 @@ export default function BuildingOwnerPortal() {
|
|||||||
iconContainerClassName="bg-[#11233a]/50 border-[#1b2c3f]/40 text-blue-400"
|
iconContainerClassName="bg-[#11233a]/50 border-[#1b2c3f]/40 text-blue-400"
|
||||||
/>
|
/>
|
||||||
<StatCard
|
<StatCard
|
||||||
variant="icon" title="Asset availability" value="38%" icon={ShieldCheck}
|
variant="icon" title="Asset availability" value="50%" icon={ShieldCheck}
|
||||||
badgeText="SLA met" badgeClassName="text-emerald-400 font-sans normal-case"
|
badgeText="SLA met" badgeClassName="text-emerald-400 font-sans normal-case"
|
||||||
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
||||||
/>
|
/>
|
||||||
@@ -67,36 +67,30 @@ export default function BuildingOwnerPortal() {
|
|||||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-4 mb-6 items-stretch">
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-4 mb-6 items-stretch">
|
||||||
|
|
||||||
{/* Left Box: Site Benchmarking Progress Lists (7 Columns) */}
|
{/* Left Box: Site Benchmarking Progress Lists (7 Columns) */}
|
||||||
<div className="lg:col-span-7 rounded-xl border border-[#142538] bg-[#091624] p-5 flex flex-col justify-between">
|
<div className="lg:col-span-7">
|
||||||
<div>
|
<Card className="p-5">
|
||||||
<div className="flex items-center justify-between mb-8">
|
<CardHeader title="Site benchmarking" subtitle="performance index" />
|
||||||
<h3 className="text-sm font-semibold text-white tracking-wide">Site benchmarking</h3>
|
|
||||||
<span className="text-[10px] font-mono text-slate-500 uppercase tracking-wider">performance index</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-6 my-2">
|
<div className="space-y-6 my-4">
|
||||||
{/* Progress Item 1 */}
|
{/* Progress Item 1 */}
|
||||||
<ProgressBarRow label="HQ Tower" value={18} maxValue={18} />
|
<ProgressBarRow label="HQ Tower" value={18} maxValue={18} />
|
||||||
|
{/* Progress Item 2 */}
|
||||||
<ProgressBarRow label="Annexe" value={13} maxValue={18} />
|
<ProgressBarRow label="Annexe" value={13} maxValue={18} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right Box: Energy Cost Bar Chart integration (5 Columns) */}
|
{/* Right Box: Energy Cost Bar Chart integration (5 Columns) */}
|
||||||
<div className="lg:col-span-5 rounded-xl border border-[#142538] bg-[#091624] p-5 flex flex-col justify-between">
|
<div className="lg:col-span-5">
|
||||||
<div className="flex items-center justify-between mb-4">
|
<Card className="p-5 h-full">
|
||||||
<h3 className="text-sm font-semibold text-white tracking-wide">
|
<CardHeader title="Energy cost outlook · ₹L" subtitle="forecast ↓" />
|
||||||
Energy cost outlook · ₹L
|
|
||||||
</h3>
|
|
||||||
<span className="text-[10px] font-mono text-slate-500 tracking-wider lowercase">
|
|
||||||
forecast ↓
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<hr className="border-[#142538] mb-6" />
|
<hr className="border-[#142538] mb-6" />
|
||||||
<div className="flex-grow flex flex-col justify-end">
|
<div className="flex-grow flex flex-col justify-end">
|
||||||
<BarChart data={energyData} />
|
<BarChart data={energyData} />
|
||||||
</div>
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* --- BOTTOM INFORMATION VIEW BANNER --- */}
|
{/* --- BOTTOM INFORMATION VIEW BANNER --- */}
|
||||||
|
|||||||
@@ -1,19 +1,26 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import {
|
import {
|
||||||
Smile,
|
Smile,
|
||||||
ShieldCheck, Database, Leaf,
|
ShieldCheck,
|
||||||
|
Database,
|
||||||
|
Leaf,
|
||||||
Plus,
|
Plus,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
import {SATISFACTION_DRIVERS,TICKETS_DATA} from "@/constants/constant";
|
import { SATISFACTION_DRIVERS, TICKETS_DATA } from "@/constants/constant";
|
||||||
import StatCard from "../../utils/dashStatCard";
|
import StatCard from "../../utils/dashStatCard";
|
||||||
import Button from "@/utils/button";
|
import Button from "@/utils/button";
|
||||||
import InfoBanner from "@/utils/infoBanner";
|
import InfoBanner from "@/utils/infoBanner";
|
||||||
|
|
||||||
|
// Import your custom Card components
|
||||||
|
import { Card } from "@/utils/cardWrapper";
|
||||||
|
import { CardHeader } from "@/utils/cardHeader";
|
||||||
|
|
||||||
export default function EngagementPage() {
|
export default function EngagementPage() {
|
||||||
return (
|
return (
|
||||||
<div className="bg-[#071321] text-[#93a3b8] font-sans antialiased min-h-screen">
|
<div className=" text-[#93a3b8] font-sans antialiased ">
|
||||||
|
|
||||||
<main className="pt-10 pb-10">
|
<main className="mt-20">
|
||||||
|
|
||||||
{/* Page Header Section */}
|
{/* Page Header Section */}
|
||||||
<div className="flex flex-col md:flex-row md:items-center justify-between gap-4 mt-4">
|
<div className="flex flex-col md:flex-row md:items-center justify-between gap-4 mt-4">
|
||||||
@@ -46,10 +53,8 @@ export default function EngagementPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Column of StatCard */}
|
{/* --- STAT CARD GRID --- */}
|
||||||
|
<div className="mt-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||||
|
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
|
||||||
<StatCard
|
<StatCard
|
||||||
variant="icon" title="Engagement score" value="82%" icon={Smile}
|
variant="icon" title="Engagement score" value="82%" icon={Smile}
|
||||||
badgeText="+4 vs Q1" badgeClassName="text-emerald-400"
|
badgeText="+4 vs Q1" badgeClassName="text-emerald-400"
|
||||||
@@ -57,7 +62,7 @@ export default function EngagementPage() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<StatCard
|
<StatCard
|
||||||
variant="icon" title="Asset availability" value="38%" icon={ShieldCheck}
|
variant="icon" title="Asset availability" value="50%" icon={ShieldCheck}
|
||||||
badgeText="SLA met" badgeClassName="text-emerald-400 font-sans normal-case"
|
badgeText="SLA met" badgeClassName="text-emerald-400 font-sans normal-case"
|
||||||
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
||||||
/>
|
/>
|
||||||
@@ -73,17 +78,15 @@ export default function EngagementPage() {
|
|||||||
badgeText="improving" badgeClassName="text-emerald-400 lowercase font-sans font-medium"
|
badgeText="improving" badgeClassName="text-emerald-400 lowercase font-sans font-medium"
|
||||||
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* (Drivers & Tickets lists columns) */}
|
{/* --- TWO COLUMNS (DRIVERS & TICKETS LISTS) --- */}
|
||||||
<div className="mt-6 grid grid-cols-1 lg:grid-cols-12 gap-6">
|
<div className="mt-4 grid grid-cols-1 lg:grid-cols-12 gap-6">
|
||||||
|
|
||||||
{/* Left Column: Satisfaction Drivers */}
|
{/* Left Column: Satisfaction Drivers */}
|
||||||
<div className="lg:col-span-7 rounded-2xl border border-[#142538] bg-[#091624] p-6">
|
<div className="lg:col-span-7">
|
||||||
<div className="flex items-center justify-between border-b border-[#142538]/40 pb-4">
|
<Card className="p-4">
|
||||||
<h3 className="font-bold text-sm text-white tracking-tight">Satisfaction drivers</h3>
|
<CardHeader title="Satisfaction drivers" subtitle="latest pulse" />
|
||||||
<span className="text-[10px] font-bold text-slate-500 uppercase tracking-wider font-mono">latest pulse</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-6 space-y-5">
|
<div className="mt-6 space-y-5">
|
||||||
{SATISFACTION_DRIVERS.map((driver) => (
|
{SATISFACTION_DRIVERS.map((driver) => (
|
||||||
@@ -104,13 +107,13 @@ export default function EngagementPage() {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right Column: Tickets & Suggestions */}
|
{/* Right Column: Tickets & Suggestions */}
|
||||||
<div className="lg:col-span-5 rounded-2xl border border-[#142538] bg-[#091624] p-6">
|
<div className="lg:col-span-5">
|
||||||
<div className="border-b border-[#142538]/40 pb-4">
|
<Card className="p-6 h-full">
|
||||||
<h3 className="font-bold text-sm text-white tracking-tight">Tickets & suggestions</h3>
|
<CardHeader title="Tickets & suggestions" />
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-2 divide-y divide-[#142538]/30">
|
<div className="mt-2 divide-y divide-[#142538]/30">
|
||||||
{TICKETS_DATA.map((ticket, index) => (
|
{TICKETS_DATA.map((ticket, index) => (
|
||||||
@@ -139,16 +142,19 @@ export default function EngagementPage() {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
<InfoBanner
|
|
||||||
|
<div className="mb-10 mt-10">
|
||||||
|
<InfoBanner
|
||||||
boldText="Closing the loop:"
|
boldText="Closing the loop:"
|
||||||
normalText="complaints become tracked FM tickets, suggestions are triaged and voted on, and declining pulse trends flag retention risk early."
|
normalText="complaints become tracked FM tickets, suggestions are triaged and voted on, and declining pulse trends flag retention risk early."
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,30 +1,28 @@
|
|||||||
|
|
||||||
import Button from "@/utils/button";
|
import Button from "@/utils/button";
|
||||||
import StatCard from "@/utils/dashStatCard";
|
import StatCard from "@/utils/dashStatCard";
|
||||||
|
import InfoBanner from "@/utils/infoBanner";
|
||||||
import { ProgressBarRow } from "@/utils/progressBarRow";
|
import { ProgressBarRow } from "@/utils/progressBarRow";
|
||||||
import {
|
import {
|
||||||
FileText,
|
FileText,
|
||||||
Wrench,
|
Wrench,
|
||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
Coins,
|
|
||||||
Smile,
|
Smile,
|
||||||
ChevronRight,
|
ChevronRight,
|
||||||
Sparkles
|
Database,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
|
// Import your custom Card components
|
||||||
|
import { Card } from "@/utils/cardWrapper";
|
||||||
|
import { CardHeader } from "@/utils/cardHeader";
|
||||||
export default function PropertyManagerPortal() {
|
export default function PropertyManagerPortal() {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen
|
<div className=" text-slate-100 mt-15 font-sans antialiased
|
||||||
text-slate-100 mt-15
|
">
|
||||||
font-sans antialiased selection:bg-teal-500/30 relative">
|
|
||||||
|
|
||||||
{/* --- HEADER SECTION --- */}
|
{/* --- HEADER SECTION --- */}
|
||||||
<div className="flex flex-col
|
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-8">
|
||||||
md:flex-row md:items-start md:justify-between
|
|
||||||
gap-4 mb-8">
|
|
||||||
<div>
|
<div>
|
||||||
<div className="flex items-center gap-2 text-[10px]
|
<div className="flex items-center gap-2 text-[10px] font-bold tracking-widest text-slate-500 uppercase font-mono">
|
||||||
font-bold tracking-widest text-slate-500 uppercase font-mono">
|
|
||||||
<span className="text-teal-400">Apple One — HQ Tower</span>
|
<span className="text-teal-400">Apple One — HQ Tower</span>
|
||||||
<span>•</span>
|
<span>•</span>
|
||||||
<span>Portal</span>
|
<span>Portal</span>
|
||||||
@@ -53,47 +51,61 @@ export default function PropertyManagerPortal() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* --- ROW 1: STATS GRID --- */}
|
{/* --- ROW 1: STATS GRID --- */}
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-3">
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||||
<StatCard
|
<StatCard
|
||||||
title="Open work orders" value="15" icon={FileText}
|
variant="icon"
|
||||||
badgeText="active" badgeClassName="text-slate-500 lowercase font-mono"
|
title="Open work orders"
|
||||||
|
value="16"
|
||||||
|
icon={FileText}
|
||||||
|
badgeText="active"
|
||||||
|
badgeClassName="text-slate-500 lowercase font-mono"
|
||||||
iconContainerClassName="bg-[#11233a]/50 border-[#1b2c3f]/40 text-blue-400"
|
iconContainerClassName="bg-[#11233a]/50 border-[#1b2c3f]/40 text-blue-400"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<StatCard
|
<StatCard
|
||||||
title="SLA compliance" value="17%" icon={ShieldCheck}
|
variant="icon"
|
||||||
badgeText="this month" badgeClassName="text-emerald-400 lowercase font-mono"
|
title="SLA compliance"
|
||||||
|
value="11%"
|
||||||
|
icon={ShieldCheck}
|
||||||
|
badgeText="this month"
|
||||||
|
badgeClassName="text-emerald-400 font-mono lowercase"
|
||||||
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<StatCard
|
<StatCard
|
||||||
title="Budget used" value="74%" icon={Coins}
|
variant="icon"
|
||||||
badgeText="FY 2026" badgeClassName="text-slate-500 font-mono"
|
title="Budget used"
|
||||||
|
value="74%"
|
||||||
|
icon={Database}
|
||||||
|
badgeText="FY 2026"
|
||||||
|
badgeClassName="text-slate-500 font-mono"
|
||||||
iconContainerClassName="bg-[#271d15] border-amber-500/10 text-amber-500"
|
iconContainerClassName="bg-[#271d15] border-amber-500/10 text-amber-500"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<StatCard
|
<StatCard
|
||||||
title="Occupant comfort" value="82%" icon={Smile}
|
variant="icon"
|
||||||
badgeText="CSAT" badgeClassName="text-emerald-400 font-mono"
|
title="Occupant comfort"
|
||||||
|
value="82%"
|
||||||
|
icon={Smile}
|
||||||
|
badgeText="CSAT"
|
||||||
|
badgeClassName="text-emerald-400 font-mono"
|
||||||
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-[#10b981]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* --- ROW 2: SPLIT GRID --- */}
|
{/* --- ROW 2: SPLIT GRID --- */}
|
||||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-4 mb-4">
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-4 mb-4 mt-5 items-stretch">
|
||||||
|
|
||||||
{/* Left Box: Work Order Status Tracking (7 Columns wide) */}
|
{/* Left Box: Work Order Status Tracking (7 Columns wide) */}
|
||||||
<div className="lg:col-span-7 rounded-xl border
|
<div className="lg:col-span-7">
|
||||||
border-[#142538] bg-[#091624] p-4 flex flex-col justify-between">
|
<Card className="p-4 h-full">
|
||||||
<div>
|
<div>
|
||||||
<div className="mb-8">
|
<CardHeader title="Work order status" />
|
||||||
<h3 className="text-sm font-semibold text-white tracking-wide">Work order status</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-4 my-2">
|
|
||||||
|
|
||||||
|
<div className="space-y-4 my-4">
|
||||||
<ProgressBarRow label="Open" value={18} maxValue={18} />
|
<ProgressBarRow label="Open" value={18} maxValue={18} />
|
||||||
<ProgressBarRow label="In Progress" value={13} maxValue={18} />
|
<ProgressBarRow label="In Progress" value={13} maxValue={18} />
|
||||||
<ProgressBarRow label="Completed" value={9} maxValue={18} />
|
<ProgressBarRow label="Completed" value={9} maxValue={18} />
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -108,14 +120,16 @@ export default function PropertyManagerPortal() {
|
|||||||
<div className="text-base font-bold text-emerald-400 mt-1">₹3.5 L/mo</div>
|
<div className="text-base font-bold text-emerald-400 mt-1">₹3.5 L/mo</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right Box: Quick Actions Accordion Links (5 Columns wide) */}
|
{/* Right Box: Quick Actions Accordion Links (5 Columns wide) */}
|
||||||
<div className="lg:col-span-5 rounded-xl border border-[#142538] bg-[#091624] p-5 flex flex-col justify-between">
|
<div className="lg:col-span-5">
|
||||||
|
<Card className="p-5 ">
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-sm font-semibold text-white tracking-wide mb-6">Quick actions</h3>
|
<CardHeader title="Quick actions" />
|
||||||
|
|
||||||
<div className="space-y-2">
|
<div className="space-y-2 mt-4">
|
||||||
{[
|
{[
|
||||||
"Track work orders",
|
"Track work orders",
|
||||||
"Energy optimization",
|
"Energy optimization",
|
||||||
@@ -135,23 +149,18 @@ export default function PropertyManagerPortal() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* --- BOTTOM INFO BANNER --- */}
|
{/* --- BOTTOM INFO BANNER --- */}
|
||||||
<div className="mb-20 rounded-xl border border-[#142538]/80 bg-[#091624]/60 p-4 border-l-2 border-l-teal-400">
|
<div className="mb-20">
|
||||||
<p className="text-xs text-slate-400 font-medium">
|
<InfoBanner
|
||||||
<span className="text-white font-bold">Manager view: </span>
|
boldText="Manager view:"
|
||||||
remote access, digital documentation archive, energy-saving optimisation, work-order tracking, automated billing and occupant-comfort monitoring.
|
normalText="remote access, digital documentation archive, energy-saving optimisation, work-order tracking, automated billing and occupant-comfort monitoring."
|
||||||
</p>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Floating Ask AI Button */}
|
|
||||||
<button className="fixed bottom-6 right-6 flex items-center gap-2 px-4 py-2.5 bg-[#14b8a6] hover:bg-[#0d9488] text-slate-900 rounded-full text-xs font-bold transition-all shadow-lg hover:scale-105 active:scale-95 z-50">
|
|
||||||
<Sparkles size={14} fill="currentColor" />
|
|
||||||
Ask AI
|
|
||||||
</button>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
243
components/dashboard/serviceEngineer.tsx
Normal file
243
components/dashboard/serviceEngineer.tsx
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
import Button from "@/utils/button";
|
||||||
|
import StatCard from "@/utils/dashStatCard";
|
||||||
|
import InfoBanner from "@/utils/infoBanner";
|
||||||
|
import {
|
||||||
|
FileText,
|
||||||
|
Wrench,
|
||||||
|
Target,
|
||||||
|
Calendar,
|
||||||
|
Brain,
|
||||||
|
Check,
|
||||||
|
} from "lucide-react";
|
||||||
|
|
||||||
|
// Import your custom Card components
|
||||||
|
import { Card } from "@/utils/cardWrapper";
|
||||||
|
import { CardHeader } from "@/utils/cardHeader";
|
||||||
|
|
||||||
|
export default function ServiceEngineerPortal() {
|
||||||
|
return (
|
||||||
|
<div className="text-slate-100 font-sans antialiased">
|
||||||
|
|
||||||
|
{/* --- HEADER SECTION --- */}
|
||||||
|
<div className="pt-20 flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-8">
|
||||||
|
<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>Portal</span>
|
||||||
|
<span>•</span>
|
||||||
|
<span>Service Engineer</span>
|
||||||
|
</div>
|
||||||
|
<h1 className="text-2xl font-extrabold text-white tracking-tight mt-2">
|
||||||
|
Service engineer portal
|
||||||
|
</h1>
|
||||||
|
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
|
||||||
|
Field cockpit — real-time asset metrics, actionable alerts, the PM schedule for today and verified task completion.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Action Buttons */}
|
||||||
|
<div className="flex items-center gap-3 self-start md:mt-6">
|
||||||
|
<Button className="flex items-center gap-2 px-4 py-2 bg-[#091624] hover:bg-[#11233a] border border-[#142538] rounded-xl text-xs font-semibold text-slate-200 transition-colors duration-200 shadow-sm">
|
||||||
|
<FileText size={14} className="text-slate-400" />
|
||||||
|
Scan Qr
|
||||||
|
</Button>
|
||||||
|
<Button className="flex items-center gap-2 px-4 py-2 bg-[#14b8a6]/10 hover:bg-[#14b8a6]/20 border border-[#14b8a6]/30 rounded-xl text-xs font-bold text-[#2dd4bf] transition-colors duration-200 shadow-sm">
|
||||||
|
<Wrench size={14} />
|
||||||
|
My Jobs
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* --- ROW 1: STATS GRID --- */}
|
||||||
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
||||||
|
<StatCard
|
||||||
|
variant="icon"
|
||||||
|
title="My Assigned Jobs"
|
||||||
|
value="6"
|
||||||
|
icon={Target}
|
||||||
|
badgeText="active"
|
||||||
|
badgeClassName="text-slate-500 lowercase font-mono"
|
||||||
|
iconContainerClassName="bg-[#11233a]/50 border-[#1b2c3f]/40 text-blue-400"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<StatCard
|
||||||
|
variant="icon"
|
||||||
|
title="Predictive Alerts"
|
||||||
|
value="2"
|
||||||
|
icon={Brain}
|
||||||
|
badgeText="action"
|
||||||
|
badgeClassName="text-red-400/90 lowercase font-mono"
|
||||||
|
iconContainerClassName="bg-[#2a171c] border-red-500/10 text-red-400"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<StatCard
|
||||||
|
variant="icon"
|
||||||
|
title="PM due today"
|
||||||
|
value="3"
|
||||||
|
icon={Calendar}
|
||||||
|
badgeText="scheduled"
|
||||||
|
badgeClassName="text-slate-500 lowercase font-mono"
|
||||||
|
iconContainerClassName="bg-[#272115] border-amber-500/10 text-amber-400"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<StatCard
|
||||||
|
variant="icon"
|
||||||
|
title="Verifies this WK"
|
||||||
|
value="12"
|
||||||
|
icon={Check}
|
||||||
|
badgeText="closed"
|
||||||
|
badgeClassName="text-emerald-400 lowercase font-mono"
|
||||||
|
iconContainerClassName="bg-[#0e2726] border-[#10b981]/15 text-emerald-400"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* --- ROW 2: SPLIT GRID (METRICS & TIMELINE) --- */}
|
||||||
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-4 mb-4 items-stretch">
|
||||||
|
|
||||||
|
{/* Left Section (8 Columns): Real-time Asset Metrics */}
|
||||||
|
<div className="lg:col-span-8">
|
||||||
|
<Card className="p-5 ">
|
||||||
|
<CardHeader title="Real-time asset metrics" subtitle="IoT / BMS" />
|
||||||
|
|
||||||
|
<div className="overflow-x-auto mt-4">
|
||||||
|
<table className=" text-left text-xs">
|
||||||
|
<thead>
|
||||||
|
<tr className="border-b border-[#142538] text-[10px] font-bold uppercase tracking-wider text-slate-500 font-mono">
|
||||||
|
<th className="pb-3">Asset · Parameter</th>
|
||||||
|
<th className="pb-3">Reading</th>
|
||||||
|
<th className="pb-3">State</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody className="divide-y divide-[#142538]/50">
|
||||||
|
<tr className="hover:bg-[#0d1f33]/30">
|
||||||
|
<td className="py-3.5 font-semibold text-slate-200">Chiller-02 · supply temp</td>
|
||||||
|
<td className="py-3.5 font-mono text-slate-300">6.8 °C</td>
|
||||||
|
<td className="py-3.5">
|
||||||
|
<span className="inline-flex items-center gap-2 text-[#2dd4bf] font-semibold">
|
||||||
|
<span className="h-1.5 w-1.5 rounded-full bg-[#14b8a6]"></span> Normal
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr className="hover:bg-[#0d1f33]/30">
|
||||||
|
<td className="py-3.5 font-semibold text-slate-200">AHU-07 · vibration</td>
|
||||||
|
<td className="py-3.5 font-mono text-slate-300">4.1 mm/s</td>
|
||||||
|
<td className="py-3.5">
|
||||||
|
<span className="inline-flex items-center gap-2 text-amber-500 font-semibold">
|
||||||
|
<span className="h-1.5 w-1.5 rounded-full bg-amber-500"></span> Watch
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr className="hover:bg-[#0d1f33]/30">
|
||||||
|
<td className="py-3.5 font-semibold text-slate-200">DG-01 · fuel level</td>
|
||||||
|
<td className="py-3.5 font-mono text-slate-300">62%</td>
|
||||||
|
<td className="py-3.5">
|
||||||
|
<span className="inline-flex items-center gap-2 text-[#2dd4bf] font-semibold">
|
||||||
|
<span className="h-1.5 w-1.5 rounded-full bg-[#14b8a6]"></span> Normal
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr className="hover:bg-[#0d1f33]/30">
|
||||||
|
<td className="py-3.5 font-semibold text-slate-200">Pump-03 · pressure</td>
|
||||||
|
<td className="py-3.5 font-mono text-slate-300">3.2 bar</td>
|
||||||
|
<td className="py-3.5">
|
||||||
|
<span className="inline-flex items-center gap-2 text-[#2dd4bf] font-semibold">
|
||||||
|
<span className="h-1.5 w-1.5 rounded-full bg-[#14b8a6]"></span> Normal
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Right Section (4 Columns): Today's Schedule Timeline */}
|
||||||
|
<div className="lg:col-span-4">
|
||||||
|
<Card className="p-5 h-full">
|
||||||
|
<CardHeader title="Today’s schedule" subtitle="runtime + condition based" />
|
||||||
|
|
||||||
|
{/* Timeline Node Flow */}
|
||||||
|
<div className="relative pl-6 space-y-8 mt-6 before:absolute before:left-[7px] before:top-2 before:bottom-2 before:w-[1px] before:bg-[#142538]">
|
||||||
|
|
||||||
|
{/* Timeline Task 1 */}
|
||||||
|
<div className="relative">
|
||||||
|
<span className="absolute -left-[25px] top-1 h-3.5 w-3.5 rounded-full border-2 border-[#14b8a6] bg-[#091624]" />
|
||||||
|
<div>
|
||||||
|
<h4 className="text-xs font-bold text-slate-200">Cooling tower cleaning</h4>
|
||||||
|
<p className="text-[10px] font-medium text-slate-500 font-mono mt-0.5">09:00 · PPM</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Timeline Task 2 */}
|
||||||
|
<div className="relative">
|
||||||
|
<span className="absolute -left-[25px] top-1 h-3.5 w-3.5 rounded-full border-2 border-[#14b8a6] bg-[#091624]" />
|
||||||
|
<div>
|
||||||
|
<h4 className="text-xs font-bold text-slate-200">AHU filter check</h4>
|
||||||
|
<p className="text-[10px] font-medium text-slate-500 font-mono mt-0.5">11:30 · PPM</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Timeline Task 3 */}
|
||||||
|
<div className="relative">
|
||||||
|
<span className="absolute -left-[25px] top-1 h-3.5 w-3.5 rounded-full border-2 border-[#14b8a6] bg-[#091624]" />
|
||||||
|
<div>
|
||||||
|
<h4 className="text-xs font-bold text-slate-200">Lift quarterly service</h4>
|
||||||
|
<p className="text-[10px] font-medium text-slate-500 font-mono mt-0.5">14:00 · AMC</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* --- ROW 3: FULL WIDTH ACTIONABLE ALERTS --- */}
|
||||||
|
<div className="mb-6">
|
||||||
|
<Card className="p-5">
|
||||||
|
<CardHeader title="Actionable alerts" />
|
||||||
|
|
||||||
|
<div className="divide-y divide-[#142538]/60 mt-4">
|
||||||
|
{/* Alert 1 */}
|
||||||
|
<div className="flex items-center justify-between py-3.5">
|
||||||
|
<div className="flex items-start gap-3">
|
||||||
|
<span className="h-2 w-2 rounded-full bg-red-400 mt-1.5 shrink-0" />
|
||||||
|
<div>
|
||||||
|
<h4 className="text-xs font-bold text-slate-200">Chiller-02 bearing wear</h4>
|
||||||
|
<p className="text-[11px] text-slate-400 mt-0.5">Raise condition-based PM</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button className="px-3.5 py-1 bg-[#11233a] hover:bg-[#1b3454] border border-[#1b3454] rounded-lg text-[11px] font-bold text-slate-200 transition-colors">
|
||||||
|
Act
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Alert 2 */}
|
||||||
|
<div className="flex items-center justify-between py-3.5">
|
||||||
|
<div className="flex items-start gap-3">
|
||||||
|
<span className="h-2 w-2 rounded-full bg-amber-400 mt-1.5 shrink-0" />
|
||||||
|
<div>
|
||||||
|
<h4 className="text-xs font-bold text-slate-200">AHU-07 belt vibration</h4>
|
||||||
|
<p className="text-[11px] text-slate-400 mt-0.5">Inspect within 10 days</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button className="px-3.5 py-1 bg-[#11233a] hover:bg-[#1b3454] border border-[#1b3454] rounded-lg text-[11px] font-bold text-slate-200 transition-colors">
|
||||||
|
Act
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* --- BOTTOM INFO BANNER --- */}
|
||||||
|
<div className="mb-20">
|
||||||
|
<InfoBanner
|
||||||
|
boldText="Engineer view:"
|
||||||
|
normalText="real-time asset metrics, actionable alerts from fault detection, runtime- and condition-based preventive maintenance, and verified task completion from the field."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -6,8 +6,11 @@ import {
|
|||||||
ChevronDown,
|
ChevronDown,
|
||||||
ChevronsLeft,
|
ChevronsLeft,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
import { useSession, signOut } from "next-auth/react";
|
||||||
export default function Sidebar() {
|
export default function Sidebar() {
|
||||||
|
const { data: session } = useSession();
|
||||||
|
console.log("Session data ",session?.user?.name)
|
||||||
|
console.log("Session data ",session?.user?.email)
|
||||||
return (
|
return (
|
||||||
<aside className="fixed bg-[#071321] text-white h-screen overflow-y-auto">
|
<aside className="fixed bg-[#071321] text-white h-screen overflow-y-auto">
|
||||||
<div className="flex items-center gap-2 px-2 pt-2 pb-3">
|
<div className="flex items-center gap-2 px-2 pt-2 pb-3">
|
||||||
@@ -64,13 +67,14 @@ export default function Sidebar() {
|
|||||||
DT
|
DT
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0 leading-tight">
|
<div className="min-w-0 leading-tight">
|
||||||
<h4 className="font-semibold text-xs text-white truncate">Dhananjay T</h4>
|
<h4 className="font-semibold text-xs text-white truncate">{session?.user?.name}</h4>
|
||||||
<p className="text-[11px] text-slate-500 truncate">
|
<p className="text-[11px] text-slate-500 truncate">
|
||||||
dhananjay@kafm.io
|
{session?.user?.email}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ChevronDown className="-rotate-90 text-slate-500 shrink-0" size={14} />
|
<ChevronDown className="-rotate-90 text-slate-500 shrink-0" size={14}
|
||||||
|
onClick={() => signOut({ callbackUrl: "/login" })} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export const SIDEBAR_ITEMS = [
|
|||||||
{ title: "Engagement", href: "/dashboard/overview/engagement", icon: Smile },
|
{ title: "Engagement", href: "/dashboard/overview/engagement", icon: Smile },
|
||||||
{ title: "Building Owner", href: "/dashboard/overview/buildingOwner", icon: Building2 },
|
{ title: "Building Owner", href: "/dashboard/overview/buildingOwner", icon: Building2 },
|
||||||
{ title: "Property Manager", href: "/dashboard/overview/propertyManager", icon: User },
|
{ title: "Property Manager", href: "/dashboard/overview/propertyManager", icon: User },
|
||||||
{ title: "Service Engineer", href: "/overview/service-engineer", icon: Target },
|
{ title: "Service Engineer", href: "/dashboard/overview/serviceEngineer", icon: Target },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
11
middleware.ts
Normal file
11
middleware.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { withAuth } from "next-auth/middleware"
|
||||||
|
|
||||||
|
export default withAuth({
|
||||||
|
pages: {
|
||||||
|
signIn: "/login",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export const config = {
|
||||||
|
matcher: ["/dashboard/:path*"],
|
||||||
|
}
|
||||||
172
package-lock.json
generated
172
package-lock.json
generated
@@ -10,6 +10,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide-react": "^1.24.0",
|
"lucide-react": "^1.24.0",
|
||||||
"next": "16.2.10",
|
"next": "16.2.10",
|
||||||
|
"next-auth": "^4.24.14",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4"
|
"react-dom": "19.2.4"
|
||||||
},
|
},
|
||||||
@@ -229,6 +230,15 @@
|
|||||||
"node": ">=6.0.0"
|
"node": ">=6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@babel/runtime": {
|
||||||
|
"version": "7.29.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz",
|
||||||
|
"integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@babel/template": {
|
"node_modules/@babel/template": {
|
||||||
"version": "7.29.7",
|
"version": "7.29.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
|
||||||
@@ -1307,6 +1317,15 @@
|
|||||||
"node": ">=12.4.0"
|
"node": ">=12.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@panva/hkdf": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@panva/hkdf/-/hkdf-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/panva"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@rtsao/scc": {
|
"node_modules/@rtsao/scc": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
|
||||||
@@ -2817,6 +2836,15 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/cookie": {
|
||||||
|
"version": "0.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
|
||||||
|
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.6",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||||
@@ -4629,6 +4657,15 @@
|
|||||||
"jiti": "lib/jiti-cli.mjs"
|
"jiti": "lib/jiti-cli.mjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jose": {
|
||||||
|
"version": "4.15.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz",
|
||||||
|
"integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/panva"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/js-tokens": {
|
"node_modules/js-tokens": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||||
@@ -5262,6 +5299,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/next-auth": {
|
||||||
|
"version": "4.24.14",
|
||||||
|
"resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.24.14.tgz",
|
||||||
|
"integrity": "sha512-YRz6xFDXKUwiXSMMChbrBEWyFktZ1qZXEgeSHQQ3nsy08B4c/xLk6REeutRsIFwkjY/1+ShHnu07DN3JeJguig==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.20.13",
|
||||||
|
"@panva/hkdf": "^1.0.2",
|
||||||
|
"cookie": "^0.7.0",
|
||||||
|
"jose": "^4.15.5",
|
||||||
|
"oauth": "^0.9.15",
|
||||||
|
"openid-client": "^5.4.0",
|
||||||
|
"preact": "^10.6.3",
|
||||||
|
"preact-render-to-string": "^5.1.19",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@auth/core": "0.34.3",
|
||||||
|
"next": "^12.2.5 || ^13 || ^14 || ^15 || ^16",
|
||||||
|
"nodemailer": "^7.0.7",
|
||||||
|
"react": "^17.0.2 || ^18 || ^19",
|
||||||
|
"react-dom": "^17.0.2 || ^18 || ^19"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@auth/core": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"nodemailer": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/next/node_modules/postcss": {
|
"node_modules/next/node_modules/postcss": {
|
||||||
"version": "8.4.31",
|
"version": "8.4.31",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
|
||||||
@@ -5319,6 +5388,12 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/oauth": {
|
||||||
|
"version": "0.9.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz",
|
||||||
|
"integrity": "sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/object-assign": {
|
"node_modules/object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
@@ -5329,6 +5404,15 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/object-hash": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/object-inspect": {
|
"node_modules/object-inspect": {
|
||||||
"version": "1.13.4",
|
"version": "1.13.4",
|
||||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||||
@@ -5442,6 +5526,48 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/oidc-token-hash": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/oidc-token-hash/-/oidc-token-hash-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-6gj2m8cJZ+iSW8bm0FXdGF0YhIQbKrfP4yWTNzxc31U6MOjfEmB1rHvlYvxI1B7t7BCi1F2vYTT6YhtQRG4hxw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "^10.13.0 || >=12.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/openid-client": {
|
||||||
|
"version": "5.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.7.1.tgz",
|
||||||
|
"integrity": "sha512-jDBPgSVfTnkIh71Hg9pRvtJc6wTwqjRkN88+gCFtYWrlP4Yx2Dsrow8uPi3qLr/aeymPF3o2+dS+wOpglK04ew==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"jose": "^4.15.9",
|
||||||
|
"lru-cache": "^6.0.0",
|
||||||
|
"object-hash": "^2.2.0",
|
||||||
|
"oidc-token-hash": "^5.0.3"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/panva"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/openid-client/node_modules/lru-cache": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"yallist": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/openid-client/node_modules/yallist": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/optionator": {
|
"node_modules/optionator": {
|
||||||
"version": "0.9.4",
|
"version": "0.9.4",
|
||||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
|
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
|
||||||
@@ -5608,6 +5734,36 @@
|
|||||||
"node": "^10 || ^12 || >=14"
|
"node": "^10 || ^12 || >=14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/preact": {
|
||||||
|
"version": "10.29.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/preact/-/preact-10.29.7.tgz",
|
||||||
|
"integrity": "sha512-DCHYrK/B10yUD3ZjLfhZ3WIE/9Vf9VFUODcRE2dRomTYDpJk6z6L9wecSfhfE6M9ZTHUdyQkoC46arIDhEV84Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/preact"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"preact-render-to-string": ">=5"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"preact-render-to-string": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/preact-render-to-string": {
|
||||||
|
"version": "5.2.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-5.2.6.tgz",
|
||||||
|
"integrity": "sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"pretty-format": "^3.8.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"preact": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/prelude-ls": {
|
"node_modules/prelude-ls": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||||
@@ -5618,6 +5774,12 @@
|
|||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pretty-format": {
|
||||||
|
"version": "3.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz",
|
||||||
|
"integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/prop-types": {
|
"node_modules/prop-types": {
|
||||||
"version": "15.8.1",
|
"version": "15.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||||
@@ -6666,6 +6828,16 @@
|
|||||||
"punycode": "^2.1.0"
|
"punycode": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
|
"deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).",
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "dist/bin/uuid"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/which": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide-react": "^1.24.0",
|
"lucide-react": "^1.24.0",
|
||||||
"next": "16.2.10",
|
"next": "16.2.10",
|
||||||
|
"next-auth": "^4.24.14",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4"
|
"react-dom": "19.2.4"
|
||||||
},
|
},
|
||||||
@@ -23,5 +24,9 @@
|
|||||||
"eslint-config-next": "16.2.10",
|
"eslint-config-next": "16.2.10",
|
||||||
"tailwindcss": "^4",
|
"tailwindcss": "^4",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
|
},
|
||||||
|
"allowScripts": {
|
||||||
|
"sharp@0.34.5": true,
|
||||||
|
"unrs-resolver@1.12.2": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user