import{a,j as r}from"./vendor-query-B2UbickB.js";import{w as l,x as c,y as m}from"./index-BZu5zewH.js";const n=[{maxMs:0,color:"text-status-error"},{maxMs:300*1e3,color:"text-status-error"},{maxMs:900*1e3,color:"text-status-warning"},{maxMs:1/0,color:"text-text-secondary"}];function u(t){if(t<=0)return n[0].color;for(const e of n)if(t<e.maxMs)return e.color;return n[n.length-1].color}function w({until:t}){const[e,s]=a.useState(()=>new Date(t).getTime()-Date.now());a.useEffect(()=>{const o=setInterval(()=>{s(new Date(t).getTime()-Date.now())},1e3);return()=>clearInterval(o)},[t]);const i=a.useMemo(()=>{const o=new Date(t);return[{label:"ms",value:String(Math.max(0,e))},{label:"until",value:o.toISOString()},{label:"local",value:l(o,"MMM d, yyyy h:mm:ss a")}]},[t,e]);return r.jsx(c,{options:i,children:r.jsx("span",{className:`text-xs font-mono ${u(e)}`,children:m(e)})})}function d(t){return!!(t.assigned_to&&t.assigned_until&&new Date(t.assigned_until)>new Date)}function g(t){return!t.workflow_type}export{w as C,d as a,g as i};
//# sourceMappingURL=escalation-Bf_SO_75.js.map
