import{j as s,r as u,d as c,b as x}from"./index-B-YXshIJ.js";import{f as b}from"./Icons-C9UDsqhh.js";import{e as h}from"./tooltips-CM5UqKwe.js";import{u as j}from"./query-hooks-C0Pc4MKj.js";const n=(a,l)=>l===0?!1:a[l-1][1].successful<a[l][1].total,v=({perEnvUsage:a,pipelineCount:l})=>{const p=j(),d=Math.max(...Object.values(a).map(({total:e})=>e)),r=Object.entries(a);return s.jsx("div",{className:"grid grid-cols-4 gap-3 items-center",children:r.map(([e,{successful:i,total:t}],o)=>s.jsxs(u.Fragment,{children:[s.jsxs("div",{className:"font-semibold text-sm flex items-center justify-end",...n(r,o)?{"data-tooltip-id":"react-tooltip","data-tooltip-html":"\n                  <b>".concat(e," </b>\n                  has more deployments\n                  (<b>").concat(t,"</b>)\n                  than successful\n                  <b> ").concat(r[o-1][0],"</b>\n                  deployments\n                  (<b>").concat(r[o-1][1].successful,"</b>)\n              ")}:{},children:[n(r,o)&&s.jsx(b,{className:"w-4 h-4 inline-block mr-1"}),e]}),s.jsxs("div",{className:"relative w-full col-span-3","data-tooltip-id":"react-tooltip","data-tooltip-html":h(e,i,t,l),children:[s.jsx("div",{className:"absolute top-0 left-0 h-full bg-lime-200 rounded-r-md border border-lime-300 z-10",style:{width:"".concat(t*100/d,"%")}}),s.jsx("div",{className:"absolute top-0 left-0 h-full bg-lime-500 rounded-r-md z-10",style:{width:"".concat(i*100/d,"%")}}),s.jsxs("div",{className:"text-sm pl-2 py-0.5 z-20 relative",children:[s.jsx("b",{children:c(t,p).map(m=>m.toFixed(2).replace(".00","")).getOr("0")}),s.jsx("span",{className:"text-xs",children:" deploys/day".concat(t>0?", ":"")}),c(i,t).map(x).map(m=>s.jsxs(s.Fragment,{children:[s.jsx("b",{children:m}),s.jsx("span",{className:"text-xs",children:" success rate"})]})).getOr(null)]})]})]},e))})};export{v as U};
