-
-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathProblemCell.tsx
More file actions
40 lines (39 loc) · 1.17 KB
/
ProblemCell.tsx
File metadata and controls
40 lines (39 loc) · 1.17 KB
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
import React from "react";
import { ProblemLink } from "../../../../components/ProblemLink";
import Problem from "../../../../interfaces/Problem";
import ProblemModel from "../../../../interfaces/ProblemModel";
import { ProblemId } from "../../../../interfaces/Status";
import { ShowDifficultyMode } from "../../../../utils/ShowDifficultyMode";
interface ProblemCellProps {
problemId: ProblemId;
problem?: Problem;
problemModel?: ProblemModel;
solvedUsers?: string[];
}
export const ProblemCell: React.FC<ProblemCellProps> = ({
problemId,
problem,
problemModel,
solvedUsers,
}): React.ReactElement => {
return (
<td style={{ width: "40%" }}>
{problem ? (
<ProblemLink
problemId={problem.id}
contestId={problem.contest_id}
problemIndex={problem.problem_index}
problemName={problem.name}
showDifficultyMode={ShowDifficultyMode.Full}
problemModel={problemModel}
isExperimentalDifficulty={problemModel?.is_experimental}
/>
) : (
problemId
)}
{solvedUsers && solvedUsers.length > 0 && (
<> solved by {solvedUsers.join(", ")}</>
)}
</td>
);
};