table constant data is added and Compliance Safety completed
This commit is contained in:
210
components/dashboard/intelligence/aiAndPredictive.tsx
Normal file
210
components/dashboard/intelligence/aiAndPredictive.tsx
Normal file
@@ -0,0 +1,210 @@
|
||||
import { useState } from 'react';
|
||||
import {
|
||||
Zap,
|
||||
AlertTriangle,
|
||||
Activity,
|
||||
Plus,
|
||||
Sparkles,
|
||||
ShieldAlert,
|
||||
IndianRupee
|
||||
} from "lucide-react";
|
||||
import Button from "@/components/common/button";
|
||||
import StatCard from "@/components/common/dashStatCard";
|
||||
import InfoBanner from '@/components/common/infoBanner';
|
||||
import {Card} from '@/components/common/cardWrapper'; // Assuming Card wrapper location
|
||||
import { CardHeader } from '@/components/common/cardHeader'; // Assuming CardHeader location
|
||||
|
||||
export default function AiPredictivePortal() {
|
||||
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 uppercase font-mono">
|
||||
<span className="text-teal-400">Apple One — HQ Tower</span>
|
||||
<span className="text-slate-500">•</span>
|
||||
<span className="text-slate-500">INTELLIGENCE</span>
|
||||
<span className="text-slate-500">•</span>
|
||||
<span className="text-slate-500">AI</span>
|
||||
</div>
|
||||
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
|
||||
AI & predictive intelligence
|
||||
</h1>
|
||||
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
|
||||
Real-time asset metrics, fault detection & diagnosis, predictive maintenance alerts and energy-saving intelligence — continuously learning.
|
||||
</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">
|
||||
<Sparkles className="w-4 h-4 text-slate-300" />
|
||||
<span>Model insights</span>
|
||||
</Button>
|
||||
|
||||
<Button className="bg-[#2dd4bf] 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>Action alert</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* --- STAT CARDS --- */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
||||
{/* Card 1: Predicted failures */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Predicted failures"
|
||||
value="1"
|
||||
icon={ShieldAlert}
|
||||
badgeText="≤ 30 days"
|
||||
badgeClassName="text-rose-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-rose-950/40 border-rose-800/30 text-rose-400"
|
||||
/>
|
||||
|
||||
{/* Card 2: Savings opportunity */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Savings opportunity"
|
||||
value="₹3.5 L"
|
||||
icon={Zap}
|
||||
badgeText="per month"
|
||||
badgeClassName="text-emerald-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-emerald-950/40 border-emerald-800/30 text-emerald-400"
|
||||
/>
|
||||
|
||||
{/* Card 3: Active anomalies */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Active anomalies"
|
||||
value="4"
|
||||
icon={AlertTriangle}
|
||||
badgeText="flagged"
|
||||
badgeClassName="text-amber-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-400"
|
||||
/>
|
||||
|
||||
{/* Card 4: Model confidence */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Model confidence"
|
||||
value="87%"
|
||||
icon={Activity}
|
||||
badgeText="average"
|
||||
badgeClassName="text-slate-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-blue-950/50 border-blue-800/30 text-blue-400"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* --- CARDS SECTION BELOW STATCARDS --- */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-6 mb-6">
|
||||
{/* Left Card: Predictive maintenance alerts */}
|
||||
<Card className="lg:col-span-7 bg-[#0b1727] border border-slate-800/80 p-5 rounded-xl">
|
||||
<CardHeader
|
||||
title="Predictive maintenance alerts"
|
||||
subtitle="ML · condition-based"
|
||||
/>
|
||||
<div className="divide-y divide-slate-800/60 mt-4">
|
||||
<div className="py-3 flex items-start justify-between">
|
||||
<div className="flex items-start gap-3">
|
||||
<span className="w-2 h-2 rounded-full bg-rose-500 mt-2 shrink-0" />
|
||||
<div>
|
||||
<h4 className="text-sm font-semibold text-slate-100">Chiller-02 compressor</h4>
|
||||
<p className="text-xs text-slate-400 mt-0.5">Bearing wear — likely failure in ~18 days</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
<span className="text-xs font-semibold text-rose-400">91%</span>
|
||||
<p className="text-[10px] text-slate-500">confidence</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="py-3 flex items-start justify-between">
|
||||
<div className="flex items-start gap-3">
|
||||
<span className="w-2 h-2 rounded-full bg-amber-400 mt-2 shrink-0" />
|
||||
<div>
|
||||
<h4 className="text-sm font-semibold text-slate-100">AHU-07 drive belt</h4>
|
||||
<p className="text-xs text-slate-400 mt-0.5">Vibration trend rising — inspect within 10 days</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
<span className="text-xs font-semibold text-amber-400">78%</span>
|
||||
<p className="text-[10px] text-slate-500">confidence</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="py-3 flex items-start justify-between">
|
||||
<div className="flex items-start gap-3">
|
||||
<span className="w-2 h-2 rounded-full bg-amber-400 mt-2 shrink-0" />
|
||||
<div>
|
||||
<h4 className="text-sm font-semibold text-slate-100">DG-01 fuel system</h4>
|
||||
<p className="text-xs text-slate-400 mt-0.5">Efficiency drop 6% — filter service due</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
<span className="text-xs font-semibold text-amber-400">84%</span>
|
||||
<p className="text-[10px] text-slate-500">confidence</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="py-3 flex items-start justify-between">
|
||||
<div className="flex items-start gap-3">
|
||||
<span className="w-2 h-2 rounded-full bg-blue-400 mt-2 shrink-0" />
|
||||
<div>
|
||||
<h4 className="text-sm font-semibold text-slate-100">Lift-03 door motor</h4>
|
||||
<p className="text-xs text-slate-400 mt-0.5">Cycle-time anomaly — monitor</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
<span className="text-xs font-semibold text-blue-400">64%</span>
|
||||
<p className="text-[10px] text-slate-500">confidence</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
{/* Right Card: Energy intelligence */}
|
||||
<Card className="lg:col-span-5 bg-[#0b1727] border border-slate-800/80 p-5 rounded-xl">
|
||||
<CardHeader
|
||||
title="Energy intelligence"
|
||||
subtitle="forecast savings"
|
||||
/>
|
||||
<div className="mt-4">
|
||||
<div className="grid grid-cols-12 text-[11px] font-semibold text-slate-400 uppercase tracking-wider pb-2 border-b border-slate-800/60">
|
||||
<div className="col-span-4">Area</div>
|
||||
<div className="col-span-5">Recommendation</div>
|
||||
<div className="col-span-3 text-right">Saving</div>
|
||||
</div>
|
||||
|
||||
<div className="divide-y divide-slate-800/60 text-xs">
|
||||
<div className="grid grid-cols-12 py-3.5 items-center">
|
||||
<div className="col-span-4 font-semibold text-slate-200">HVAC scheduling</div>
|
||||
<div className="col-span-5 text-slate-400">Shift pre-cooling to off-peak</div>
|
||||
<div className="col-span-3 text-right font-medium text-emerald-400">₹1.8 L/mo</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 py-3.5 items-center">
|
||||
<div className="col-span-4 font-semibold text-slate-200">Lighting</div>
|
||||
<div className="col-span-5 text-slate-400">Daylight dimming zones L2–L5</div>
|
||||
<div className="col-span-3 text-right font-medium text-emerald-400">₹0.6 L/mo</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-12 py-3.5 items-center">
|
||||
<div className="col-span-4 font-semibold text-slate-200">Chiller staging</div>
|
||||
<div className="col-span-5 text-slate-400">Optimise sequencing logic</div>
|
||||
<div className="col-span-3 text-right font-medium text-emerald-400">₹1.1 L/mo</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<div className="mt-5">
|
||||
<InfoBanner
|
||||
boldText='How it works:'
|
||||
normalText='IoT/BMS sensor streams feed fault-detection models → predictions surface as alerts → one click raises a condition-based PM work order → verified completion feeds back to improve the model.'
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
108
components/dashboard/intelligence/assetHealth.tsx
Normal file
108
components/dashboard/intelligence/assetHealth.tsx
Normal file
@@ -0,0 +1,108 @@
|
||||
import { useState } from 'react';
|
||||
import {
|
||||
Zap,
|
||||
AlertTriangle,
|
||||
Activity,
|
||||
Plus,
|
||||
Sparkles,
|
||||
ShieldAlert,
|
||||
IndianRupee,
|
||||
Clock,
|
||||
ShieldCheck
|
||||
} from "lucide-react";
|
||||
import Button from "@/components/common/button";
|
||||
import StatCard from "@/components/common/dashStatCard";
|
||||
import InfoBanner from '@/components/common/infoBanner';
|
||||
import {Card} from '@/components/common/cardWrapper'; // Assuming Card wrapper location
|
||||
import { CardHeader } from '@/components/common/cardHeader'; // Assuming CardHeader location
|
||||
|
||||
export default function AssetHealthPortal() {
|
||||
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 uppercase font-mono">
|
||||
<span className="text-teal-400">Apple One — HQ Tower</span>
|
||||
<span className="text-slate-500">•</span>
|
||||
<span className="text-slate-500">INTELLIGENCE</span>
|
||||
<span className="text-slate-500">•</span>
|
||||
<span className="text-slate-500">ASSET HEALTH</span>
|
||||
</div>
|
||||
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
|
||||
Asset health & reliability
|
||||
</h1>
|
||||
<p className="text-sm font-medium text-slate-400 mt-2 max-w-xl leading-relaxed">
|
||||
A live health index per asset from reliability signals — MTBF, MTTR and criticality drive condition-based PM instead of fixed calendars.
|
||||
</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">
|
||||
<Activity className="w-4 h-4 text-slate-300" />
|
||||
<span>Model insights</span>
|
||||
</Button>
|
||||
|
||||
<Button className="bg-[#2dd4bf] 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>Raise PM</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* --- STAT CARDS --- */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
||||
{/* Card 1: Predicted failures */}
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Fleet health index"
|
||||
value="69"
|
||||
icon={ShieldCheck}
|
||||
badgeText="weighted"
|
||||
badgeClassName="text-amber-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-amber-950/40 border-amber-800/30 text-amber-400"
|
||||
/>
|
||||
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Assets at risk"
|
||||
value="1"
|
||||
icon={AlertTriangle}
|
||||
badgeText="health < 58"
|
||||
badgeClassName="text-rose-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-rose-950/40 border-rose-800/30 text-rose-400"
|
||||
/>
|
||||
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Mean time between failures"
|
||||
value="204d"
|
||||
icon={Clock}
|
||||
badgeText="avg"
|
||||
badgeClassName="text-blue-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-blue-950/50 border-blue-800/30 text-blue-400"
|
||||
/>
|
||||
|
||||
<StatCard
|
||||
variant="icon"
|
||||
title="Mean time to repair"
|
||||
value="6.3h"
|
||||
icon={Activity}
|
||||
badgeText="avg"
|
||||
badgeClassName="text-emerald-400 lowercase font-mono"
|
||||
iconContainerClassName="bg-emerald-950/40 border-emerald-800/30 text-emerald-400"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div className="mt-5">
|
||||
<InfoBanner
|
||||
boldText="How it works:"
|
||||
normalText="reliability signals (runtime, faults, vibration, PPM history) roll into a 0–100 health index. Assets that drop below threshold auto-surface here and can raise a condition-based PM in one click — replacing fixed-calendar servicing on healthy assets."
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user