code review

This commit is contained in:
rngsurrounded
2025-03-02 02:29:57 +09:00
parent a37d9e4f9b
commit aa6f581681
7 changed files with 7 additions and 15 deletions
@@ -5,13 +5,11 @@ import { Solution } from "@/shared/types";
import { mockSolutions } from '@/shared/mocks/mocks';
interface ActionButtonsProps {
onHistoryClick: () => void;
onSubmit: () => void;
solutionHistory?: Solution[];
}
const ActionButtons: React.FC<ActionButtonsProps> = ({
onHistoryClick,
onSubmit,
solutionHistory = mockSolutions
}) => {
@@ -19,7 +17,6 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
const handleHistoryClick = () => {
setIsHistoryOpen(true);
onHistoryClick();
};
return (
@@ -1,6 +1,6 @@
import React, { useRef, useEffect, useState } from 'react';
import * as monaco from 'monaco-editor';
import { Copy, Check } from 'lucide-react'; // Import Lucide React icons
import { Copy, Check } from 'lucide-react';
interface CodeSolutionProps {
answer: string;
@@ -41,4 +41,4 @@ const SolutionStatus: React.FC<SolutionStatusProps> = ({ solution }) => {
);
};
export default SolutionStatus;
export default SolutionStatus;
@@ -12,7 +12,7 @@ interface TaskSolutionProps {
answer: string;
setAnswer: (value: string) => void;
onSubmit: () => void;
onHistoryClick: () => void;
}
const TaskSolution: React.FC<TaskSolutionProps> = ({
@@ -21,7 +21,6 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
answer,
setAnswer,
onSubmit,
onHistoryClick,
}) => {
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const fileInputRef = useRef<HTMLInputElement>(null);
@@ -46,7 +45,7 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
<CodeSolution answer={answer} setAnswer={setAnswer} />
)}
<ActionButtons onHistoryClick={onHistoryClick} onSubmit={onSubmit} />
<ActionButtons onSubmit={onSubmit} />
</div>
);
};