import React, { useState, useEffect } from "react"; import { useParams, useNavigate } from "react-router"; import { toast } from "react-toastify"; import { getWorkOrderById } from "../api"; import "./WorkOrderViewPage.css"; function formatDateTime(value) { const d = new Date(value.endsWith("Z") ? value : value + "Z"); if (isNaN(d)) return value; const date = d.toLocaleDateString("en-CA"); const time = d.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit", hour12: false }); const tz = d.toLocaleTimeString(undefined, { timeZoneName: "short" }).split(" ").pop(); return `${date} ${time} ${tz}`; } function CommentTimeline({ comments }) { if (!comments || comments.length === 0) { return
No comments yet.
; } return (No changes recorded.
; } return ({wo.description || "No description provided."}