mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 02:47:10 +00:00
fix build errors
This commit is contained in:
@@ -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} />
|
||||||
|
|||||||
Reference in New Issue
Block a user