import { useState } from 'react';
import {
BarChart2,
Check,
AlertTriangle,
Clock,
CheckCircle2,
Cpu
} from "lucide-react";
import Button from "@/components/common/button";
import StatCard from "@/components/common/dashStatCard";
export default function AlarmRulesPortal() {
// State for automation rules toggles
const [autoWorkOrder, setAutoWorkOrder] = useState(true);
const [escalateCriticals, setEscalateCriticals] = useState(true);
const [offHoursSetpoint, setOffHoursSetpoint] = useState(true);
const [filterPpmTask, setFilterPpmTask] = useState(false);
return (
{/* --- HEADER SECTION --- */}
APPLE ONE — HQ TOWER
•
IOT
•
ALARMS & RULES
Alarms & automation rules
Acknowledge live alarms, raise work orders in one click, and manage the automation rules that act on telemetry.
{/* --- HEADER BUTTONS --- */}
{/* --- STAT CARDS --- */}
{/* Card 1: Critical open */}
{/* Card 2: Warnings open */}
{/* Card 3: Acknowledged */}
{/* Card 4: Rules active */}
{/* --- MAIN CONTENT GRID --- */}
{/* --- LEFT SECTION: ALARMS LIST --- */}
Alarms
live · newest first
{/* Alarm Item 1 */}
CH-02
{" · "}
Condenser approach high — 4.2 K above design
08:41 · open
{/* Alarm Item 2 */}
AHU-07
{" · "}
Filter ΔP beyond limit — replacement due
08:12 · open
{/* Alarm Item 3 */}
CTL-14
{" · "}
Controller offline — no heartbeat for 30 min
07:56 · open
{/* Alarm Item 4 */}
SNS-208
{" · "}
CO₂ trending up in open office L3 — 1,080 ppm
07:30 · acknowledged
{/* Alarm Item 5 */}
GW-01
{" · "}
Gateway reconnected after 90 s network drop
06:58 · acknowledged
{/* --- RIGHT SECTION: AUTOMATION RULES --- */}
Automation rules
telemetry → action
{/* Rule 1 */}
Auto work order on critical alarm
Raises a Help Desk request with the asset and fault pre-filled
{/* Rule 2 */}
Escalate unacknowledged criticals
Notifies the escalation matrix after 15 minutes
{/* Rule 3 */}
Off-hours setpoint relaxation
Widens comfort bands 22:00–06:00 to save energy
{/* Rule 4 */}
Filter ΔP → PPM task
Adds a filter change to the next PPM visit automatically
);
}