import{r as l}from"./vendor-react-wBh_31cN.js";import{b as c,c as u}from"./index-7v8-2hdX.js";import{c as p}from"./vendor-router-D1GqFWiT.js";import{m as E}from"./mergeDeepRight-BeT6gxx6.js";import{e5 as d}from"./index-BKr2rJhV.js";const v=({projectId:r,jobName:a,execution:e})=>{const{id:n}=p(),i={pId:r??n,name:a,execId:(e==null?void 0:e.id)??0},{currentData:o}=c.getJobExecution.useQueryState(i),t=E(e??{},o??{}),s=(t==null?void 0:t.finalStatus)==="UNDEFINED"||(t==null?void 0:t.state)==="AGGREGATING_LOGS";return u(i,{skip:!s,pollingInterval:5e3}),l.useMemo(()=>({execution:t,isStillExecuting:s}),[t,s])},N=(r,a=[])=>{const e=a.filter(n=>n.state==="RUNNING").length;if(e)return{label:`${e} ${e>1?"executions":"execution"} in progress`,variant:"secondary",spinning:!0};switch(r){case"SUCCEEDED":return{label:"Success",variant:"success"};case"FAILED":return{label:"Fail",variant:"destructive"};case"IN_PROGRESS":return{label:"In progress",variant:"secondary",spinning:!0};case"KILLED":return{label:"Killed",variant:"outline"};case"UNDEFINED":return{label:"-",variant:"outline",spinning:!0};default:return{label:r?d(r).replaceAll("_"," "):"-",variant:"outline"}}};export{N as g,v as u};
