aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/SubmitStatusLabel.tsx
blob: 2d4890d7d7b6a430293f2bfdd1793340bda3698d (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
import type { SubmitResultStatus } from "../models/SubmitResult";

type Props = {
	status: SubmitResultStatus;
};

export default function SubmitStatusLabel({ status }: Props) {
	switch (status) {
		case "waiting_submission":
			return <span>-</span>;
		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>;
	}
}