Merge remote-tracking branch 'origin/master'

This commit is contained in:
Андрей Сумин
2025-03-02 16:59:44 +03:00
3 changed files with 12 additions and 5 deletions
@@ -1,7 +1,6 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Task } from '@/shared/types/task';
import { getTaskBgColor, getTaskTextColor } from '../../utils/utils';
interface CompetitionHeaderProps {
title: string;
@@ -20,7 +20,7 @@ interface TaskSolutionProps {
const TaskSolution: React.FC<TaskSolutionProps> = ({
task,
solutions,
solutions = [],
answer,
setAnswer,
onSubmit,
@@ -42,9 +42,17 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
setIsHistoryOpen(true);
};
const latestSolution = solutions && solutions.length > 0 ? solutions[0] : null;
return (
<div className="md:w-[500px] flex flex-col gap-4">
<SolutionStatus solution={solutions[0]} maxPoints={task.points}/>
{latestSolution ? (
<SolutionStatus solution={latestSolution} maxPoints={task.points}/>
) : (
<div className="bg-gray-100 rounded-lg p-4 text-gray-600 font-hse-sans">
Решение еще не отправлено
</div>
)}
{task.type === TaskType.INPUT && (
<InputSolution answer={answer} setAnswer={setAnswer} />
+2 -2
View File
@@ -15,8 +15,8 @@ export interface TaskAttachment {
enum TaskType {
INPUT = "input",
FILE = "file",
CODE = "code",
FILE = "checker",
CODE = "review",
}
enum SolutionStatus {