Skip to content

Commit

Permalink
feat: display similar papers
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkhandeparkar committed Oct 7, 2024
1 parent 9b60fc6 commit 1cb4041
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion frontend/src/components/Common/PaperEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import COURSE_CODE_MAP from "../../data/courses.json";
import { makeRequest } from "../../utils/backend";
import { IEndpointTypes } from "../../types/backend";
import { useAuthContext } from "../../utils/auth";
import { QPCard } from "../AdminDashboard/QPCard";

type UpdateQPHandler<T> = (qp: T) => void;
interface IPaperEditModalProps<T> {
Expand Down Expand Up @@ -310,7 +311,19 @@ function PaperEditModal<T extends IQuestionPaperFile | IAdminDashboardQP>(props:
{
awaitingSimilarPapers ? <div style={{ justifyContent: 'center', display: 'flex' }}><Spinner /></div> :
<div>

{
similarPapers.length === 0 ? <p>No similar papers found.</p> :
similarPapers.map((paper, i) => <QPCard
onEdit={(e) => {
e.preventDefault();
}}
onDelete={() => {
}}
qPaper={paper}
key={i}
/>
)
}
</div>
}
</div>
Expand Down

0 comments on commit 1cb4041

Please sign in to comment.