import{t as e}from"./jsx-runtime-DLhMyTcm.js";import{s as t}from"./table-CCNPbiUy.js";function n(e){return e.charAt(0).toUpperCase()+e.slice(1)}function r(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function i(e,t=1){return`${e.toFixed(t)}%`}function a(e){return e===0?`$0`:`$${e.toFixed(2)}`}var o=e();function s({status:e}){let r=e=>{switch(e){case`pending`:return`bg-amber-100 text-amber-700 border-amber-200`;case`running`:return`bg-blue-100 text-blue-700 border-blue-200 animate-pulse`;case`completed`:return`bg-emerald-100 text-emerald-700 border-emerald-200`;case`failed`:return`bg-red-100 text-red-700 border-red-200`;case`retrying`:return`bg-orange-100 text-orange-700 border-orange-200`;case`awaiting_approval`:return`bg-purple-100 text-purple-700 border-purple-200 animate-pulse`;case`rejected`:return`bg-rose-100 text-rose-700 border-rose-200`;case`cancelled`:case`skipped`:return`bg-gray-100 text-gray-600 border-gray-200`;default:return e}},i=n(e);return(0,o.jsx)(t,{variant:`outline`,className:`text-xs font-medium ${r(e)}`,children:i})}function c({date:e}){return(0,o.jsx)(`span`,{children:(e=>{let t=new Date,n=new Date(e),r=Math.floor((t.getTime()-n.getTime())/1e3);return r<60?`just now`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:n.toLocaleDateString()})(e)})}export{r as a,a as i,s as n,i as o,n as r,c as t};