// Woodbury Operator — Ticket Detail (progress tracker). Registers window.TicketDetailScreen. (function () { const NS = window.WoodburyPropertiesDesignSystem_7290ca; const { Card, CardHeader, Button, Badge, Avatar, IconTile, Eyebrow, Modal, Select, Textarea, Input } = NS; // Progress stages a ticket moves through. const STAGES = ["Reported", "Vendor Assigned", "Scheduled", "In Progress", "Resolved"]; function TicketDetailScreen({ onBack }) { const seed = window.WB_ACTIVE_TICKET || { unit: "House 1 — AC Leak", asset: "Lashibi Townhouses", icon: "wind", badge: "Urgent", badgeTone: "danger", vendor: "AirCool HVAC Services", vendorTrade: "HVAC", vendorPhone: "+233 55 880 9910", tenant: "Kofi Mensah", tenantUnit: "House 1", reported: "18 Aug 2026 · 09:12", reportDate: "20 Aug 2026", priority: "Urgent", stageIndex: 1, description: "Unit making a loud grinding noise and not cooling. Started overnight.", }; const [stage, setStage] = React.useState(seed.stageIndex || 1); const [log, setLog] = React.useState([ { icon: "user-check", tone: "accent", title: "Vendor assigned", body: seed.vendor + " assigned to the ticket.", time: "18 Aug · 09:40" }, { icon: "wrench", tone: "danger", title: "Ticket reported", body: seed.description, time: seed.reported }, ]); const [update, setUpdate] = React.useState(false); const [uStage, setUStage] = React.useState(STAGES[Math.min(stage + 1, STAGES.length - 1)]); const [uNote, setUNote] = React.useState(""); const [notifyTenant, setNotifyTenant] = React.useState(true); const applyUpdate = () => { const idx = STAGES.indexOf(uStage); setStage(idx); setLog((l) => [{ icon: "activity", tone: "brand", title: "Status → " + uStage, body: uNote || "Progress updated.", time: "Just now" }, ...l]); setUpdate(false); setUNote(""); window.WBToast(notifyTenant ? "Progress updated · " + seed.tenant + " notified" : "Progress updated"); }; return (
{e.body}