@@ -14,6 +14,8 @@ import { WorkflowTabHierarchy } from "../modals/EventDetails";
1414import ButtonLikeAnchor from "../../../shared/ButtonLikeAnchor" ;
1515import { ParseKeys } from "i18next" ;
1616import ModalContentTable from "../../../shared/modals/ModalContentTable" ;
17+ import { LuCheck , LuEllipsis , LuLoader , LuPause , LuRotateCcw , LuX } from "react-icons/lu" ;
18+ import { GoDash } from "react-icons/go" ;
1719
1820/**
1921 * This component manages the workflow operations for the workflows tab of the event details modal
@@ -149,7 +151,10 @@ export const Operation = ({
149151
150152 return (
151153 < tr >
152- < td > { t ( item . status as ParseKeys ) } </ td >
154+ < td style = { { display : "flex" , alignItems : "center" } } >
155+ < OperationStatusIcon status = { item . status } />
156+ { t ( item . status as ParseKeys ) }
157+ </ td >
153158 < td > { item . title } </ td >
154159 < td > { item . description } </ td >
155160
@@ -172,4 +177,34 @@ export const Operation = ({
172177 ) ;
173178} ;
174179
180+ const OperationStatusIcon = ( {
181+ status,
182+ } : {
183+ status : string
184+ } ) => {
185+ // Parse translation key to state
186+ const state = status . split ( "." ) . pop ( ) ;
187+
188+ const iconStyle = { marginRight : "5px" } ;
189+
190+ switch ( state ) {
191+ case "INSTANTIATED" :
192+ return < LuEllipsis style = { { ...iconStyle , color : "#666" } } /> ;
193+ case "RUNNING" :
194+ return < LuLoader className = "fa-spin" style = { { ...iconStyle , color : "#666" } } /> ;
195+ case "PAUSED" :
196+ return < LuPause style = { { ...iconStyle , color : "#666" } } /> ;
197+ case "SUCCEEDED" :
198+ return < LuCheck style = { { ...iconStyle , color : "#37c180" } } /> ;
199+ case "FAILED" :
200+ return < LuX style = { { ...iconStyle , color : "#fa1919" } } /> ;
201+ case "SKIPPED" :
202+ return < GoDash style = { { ...iconStyle , color : "#378dd4" } } /> ;
203+ case "RETRY" :
204+ return < LuRotateCcw className = "fa-spin" style = { { ...iconStyle , color : "#666" } } /> ;
205+ default :
206+ return < > </ > ;
207+ }
208+ }
209+
175210export default EventDetailsWorkflowOperations ;
0 commit comments