aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/Gaming/ExecStatusIndicatorIcon.tsx
blob: 2bf088b4cbf724489910df4f665028ae981a34a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import {
  faCircle,
  faCircleCheck,
  faCircleExclamation,
  faRotate,
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import type { components } from "../../api/schema";

type Props = {
  status: components["schemas"]["ExecutionStatus"];
};

export default function ExecStatusIndicatorIcon({ status }: Props) {
  switch (status) {
    case "none":
      return (
        <FontAwesomeIcon icon={faCircle} fixedWidth className="text-gray-400" />
      );
    case "running":
      return (
        <FontAwesomeIcon
          icon={faRotate}
          spin
          fixedWidth
          className="text-gray-700"
        />
      );
    case "success":
      return (
        <FontAwesomeIcon
          icon={faCircleCheck}
          fixedWidth
          className="text-brand-500"
        />
      );
    default:
      return (
        <FontAwesomeIcon
          icon={faCircleExclamation}
          fixedWidth
          className="text-red-500"
        />
      );
  }
}