From 9f022ce7e59213284896a07a53bfef232a6e62d3 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Mon, 12 Aug 2024 02:03:17 +0900
Subject: refactor(frontend): create SubmitStatusLabel component

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

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

diff --git a/frontend/app/components/SubmitStatusLabel.tsx b/frontend/app/components/SubmitStatusLabel.tsx
new file mode 100644
index 0000000..f6e19bb
--- /dev/null
+++ b/frontend/app/components/SubmitStatusLabel.tsx
@@ -0,0 +1,24 @@
+import type { SubmitResultStatus } from "../models/SubmitResult";
+
+type Props = {
+	status: SubmitResultStatus;
+};
+
+export default function SubmitStatusLabel({ status }: Props) {
+	switch (status) {
+		case "running":
+			return <span>Running...</span>;
+		case "success":
+			return <span>Accepted</span>;
+		case "wrong_answer":
+			return <span>Wrong Answer</span>;
+		case "timeout":
+			return <span>Time Limit Exceeded</span>;
+		case "compile_error":
+			return <span>Compile Error</span>;
+		case "runtime_error":
+			return <span>Runtime Error</span>;
+		case "internal_error":
+			return <span>Internal Error</span>;
+	}
+}
-- 
cgit v1.3.1

