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 React from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { Task } from '@/shared/types/task'; import { Task } from '@/shared/types/task';
import { getTaskBgColor, getTaskTextColor } from '../../utils/utils';
interface CompetitionHeaderProps { interface CompetitionHeaderProps {
title: string; title: string;
@@ -20,7 +20,7 @@ interface TaskSolutionProps {
const TaskSolution: React.FC<TaskSolutionProps> = ({ const TaskSolution: React.FC<TaskSolutionProps> = ({
task, task,
solutions, solutions = [],
answer, answer,
setAnswer, setAnswer,
onSubmit, onSubmit,
@@ -42,9 +42,17 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
setIsHistoryOpen(true); setIsHistoryOpen(true);
}; };
const latestSolution = solutions && solutions.length > 0 ? solutions[0] : null;
return ( return (
<div className="md:w-[500px] flex flex-col gap-4"> <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 && ( {task.type === TaskType.INPUT && (
<InputSolution answer={answer} setAnswer={setAnswer} /> <InputSolution answer={answer} setAnswer={setAnswer} />
+2 -2
View File
@@ -15,8 +15,8 @@ export interface TaskAttachment {
enum TaskType { enum TaskType {
INPUT = "input", INPUT = "input",
FILE = "file", FILE = "checker",
CODE = "code", CODE = "review",
} }
enum SolutionStatus { enum SolutionStatus {