mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 08:42:13 +02:00
- Updated import statements in ComponentSettingsModal, ComponentValuePickerModal, ComponentsModal, DocumentationViewer, RunForm, RunModal, Utils, VariableModal, Workflow, WorkflowStatus, Config, EntityFieldType, and various API utility files to reflect the new directory structure. - Ensured all imports from "Common/Types" are now sourced from "../../../Types" to maintain consistency and improve module resolution.
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import Pill from "../Pill/Pill";
|
|
import { Blue, Red, Yellow } from "../../../Types/BrandColors";
|
|
import WorkflowStatus from "../../../Types/Workflow/WorkflowStatus";
|
|
import React, { FunctionComponent, ReactElement } from "react";
|
|
|
|
export interface ComponentProps {
|
|
status: WorkflowStatus;
|
|
}
|
|
|
|
const WorkflowStatusElement: FunctionComponent<ComponentProps> = (
|
|
props: ComponentProps,
|
|
): ReactElement => {
|
|
if (props.status === WorkflowStatus.Success) {
|
|
return <Pill color={Blue} text="Executed" />;
|
|
}
|
|
if (props.status === WorkflowStatus.Running) {
|
|
return <Pill color={Yellow} text="Running" />;
|
|
}
|
|
if (props.status === WorkflowStatus.Scheduled) {
|
|
return <Pill color={Yellow} text="Scheduled" />;
|
|
}
|
|
if (props.status === WorkflowStatus.Error) {
|
|
return <Pill color={Red} text="Error" />;
|
|
}
|
|
|
|
if (props.status === WorkflowStatus.Timeout) {
|
|
return <Pill color={Red} text="Timeout" />;
|
|
}
|
|
|
|
if (props.status === WorkflowStatus.WorkflowCountExceeded) {
|
|
return <Pill color={Red} text="Execution Exceeded Current Plan" />;
|
|
}
|
|
|
|
return <Pill color={Yellow} text="Unknown" />;
|
|
};
|
|
|
|
export default WorkflowStatusElement;
|