From 04ff82d35e9cbd3d2a86204260f58a370fda88da Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sat, 10 Aug 2024 21:58:13 +0900
Subject: feat(frontend): show status indicator icon

---
 .../app/components/ExecStatusIndicatorIcon.tsx     | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 frontend/app/components/ExecStatusIndicatorIcon.tsx

(limited to 'frontend/app/components/ExecStatusIndicatorIcon.tsx')

diff --git a/frontend/app/components/ExecStatusIndicatorIcon.tsx b/frontend/app/components/ExecStatusIndicatorIcon.tsx
new file mode 100644
index 0000000..a76e957
--- /dev/null
+++ b/frontend/app/components/ExecStatusIndicatorIcon.tsx
@@ -0,0 +1,45 @@
+import {
+	faBan,
+	faCircleCheck,
+	faCircleExclamation,
+	faRotate,
+} from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
+type Props = {
+	status: string;
+};
+
+export default function ExecStatusIndicatorIcon({ status }: Props) {
+	switch (status) {
+		case "running":
+			return (
+				<FontAwesomeIcon
+					icon={faRotate}
+					spin
+					fixedWidth
+					className="text-gray-700"
+				/>
+			);
+		case "success":
+			return (
+				<FontAwesomeIcon
+					icon={faCircleCheck}
+					fixedWidth
+					className="text-green-500"
+				/>
+			);
+		case "canceled":
+			return (
+				<FontAwesomeIcon icon={faBan} fixedWidth className="text-gray-400" />
+			);
+		default:
+			return (
+				<FontAwesomeIcon
+					icon={faCircleExclamation}
+					fixedWidth
+					className="text-red-500"
+				/>
+			);
+	}
+}
-- 
cgit v1.3.1

