x-star-design 0.0.35 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export declare enum Status {
|
|
3
|
+
Abnormal = "Abnormal",
|
|
4
|
+
Accepted = "Accepted",
|
|
5
|
+
CheckerJudgementFailed = "Checker Judgement Failed",
|
|
6
|
+
CompileError = "Compile Error",
|
|
7
|
+
DangerousSyscall = "Dangerous Syscall",
|
|
8
|
+
JudgeFailed = "Judge Failed",
|
|
9
|
+
JudgementFailed = "Judgement Failed",
|
|
10
|
+
MemoryLimitExceeded = "Memory Limit Exceeded",
|
|
11
|
+
OutputLimitExceeded = "Output Limit Exceeded",
|
|
12
|
+
Pending = "Pending",
|
|
13
|
+
PresentationError = "Presentation Error",
|
|
14
|
+
Running = "Running",
|
|
15
|
+
RuntimeError = "Runtime Error",
|
|
16
|
+
Skipped = "Skipped",
|
|
17
|
+
SpecialJudgeError = "Special Judge Error",
|
|
18
|
+
TimeLimitExceeded = "Time Limit Exceeded",
|
|
19
|
+
Unknown = "Unknown",
|
|
20
|
+
WrongAnswer = "Wrong Answer"
|
|
21
|
+
}
|
|
2
22
|
type SubmissionStatusProps = {
|
|
3
|
-
status:
|
|
23
|
+
status: Status;
|
|
4
24
|
className?: string;
|
|
5
25
|
onClick?: () => void;
|
|
6
26
|
style?: React.CSSProperties;
|
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { Tooltip } from 'antd';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
|
|
5
|
+
import ConfigProviderWrapper from "../config-provider-wrapper";
|
|
6
|
+
import { useLocale } from "../locales";
|
|
7
|
+
export var Status = /*#__PURE__*/function (Status) {
|
|
8
|
+
Status["Abnormal"] = "Abnormal";
|
|
9
|
+
Status["Accepted"] = "Accepted";
|
|
10
|
+
Status["CheckerJudgementFailed"] = "Checker Judgement Failed";
|
|
11
|
+
Status["CompileError"] = "Compile Error";
|
|
12
|
+
Status["DangerousSyscall"] = "Dangerous Syscall";
|
|
13
|
+
Status["JudgeFailed"] = "Judge Failed";
|
|
14
|
+
Status["JudgementFailed"] = "Judgement Failed";
|
|
15
|
+
Status["MemoryLimitExceeded"] = "Memory Limit Exceeded";
|
|
16
|
+
Status["OutputLimitExceeded"] = "Output Limit Exceeded";
|
|
17
|
+
Status["Pending"] = "Pending";
|
|
18
|
+
Status["PresentationError"] = "Presentation Error";
|
|
19
|
+
Status["Running"] = "Running";
|
|
20
|
+
Status["RuntimeError"] = "Runtime Error";
|
|
21
|
+
Status["Skipped"] = "Skipped";
|
|
22
|
+
Status["SpecialJudgeError"] = "Special Judge Error";
|
|
23
|
+
Status["TimeLimitExceeded"] = "Time Limit Exceeded";
|
|
24
|
+
Status["Unknown"] = "Unknown";
|
|
25
|
+
Status["WrongAnswer"] = "Wrong Answer";
|
|
26
|
+
return Status;
|
|
27
|
+
}({});
|
|
28
|
+
var scopeColor = new Map([[Status.Accepted, '#00ad07'], [Status.WrongAnswer, '#f44336'], [Status.TimeLimitExceeded, '#56A2F5'], [Status.CompileError, '#F5B13D'], [Status.RuntimeError, '#F56ED3'], [Status.MemoryLimitExceeded, '#9256F5'], [Status.Running, '#ffa500'], [Status.Abnormal, '#9256F5'], [Status.Pending, '#ffa500']]);
|
|
29
|
+
var statusZh = new Map([[Status.Abnormal, ''], [Status.Accepted, '答案正确'], [Status.CheckerJudgementFailed, '代码检查失败'], [Status.CompileError, '编译错误'], [Status.DangerousSyscall, '危险系统调用'], [Status.JudgeFailed, '评测失败'], [Status.JudgementFailed, '评测失败'], [Status.MemoryLimitExceeded, '内存超限'], [Status.OutputLimitExceeded, '输出超限'], [Status.Pending, '排队'], [Status.PresentationError, '段错误'], [Status.Running, '运行'], [Status.RuntimeError, '运行出错'], [Status.Skipped, '忽略'], [Status.SpecialJudgeError, ''], [Status.TimeLimitExceeded, '运行超时'], [Status.Unknown, 'OI赛制提交结果不可见'], [Status.WrongAnswer, '答案错误']]);
|
|
5
30
|
var SubmissionStatus = function SubmissionStatus(_ref) {
|
|
6
31
|
var className = _ref.className,
|
|
7
32
|
status = _ref.status,
|
|
8
33
|
onClick = _ref.onClick,
|
|
9
34
|
style = _ref.style;
|
|
10
|
-
|
|
35
|
+
var _useLocale = useLocale('CodeDetailModal'),
|
|
36
|
+
locale = _useLocale.locale;
|
|
37
|
+
return /*#__PURE__*/React.createElement(ConfigProviderWrapper, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
38
|
+
title: locale === 'zh_CN' && (statusZh === null || statusZh === void 0 ? void 0 : statusZh.get(status))
|
|
39
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11
40
|
className: classNames(className),
|
|
12
41
|
style: _objectSpread({
|
|
13
42
|
cursor: onClick ? 'pointer' : 'initial',
|
|
@@ -15,6 +44,6 @@ var SubmissionStatus = function SubmissionStatus(_ref) {
|
|
|
15
44
|
color: scopeColor.get(status)
|
|
16
45
|
}, style),
|
|
17
46
|
onClick: onClick
|
|
18
|
-
}, status);
|
|
47
|
+
}, status)));
|
|
19
48
|
};
|
|
20
49
|
export default SubmissionStatus;
|