diff --git a/src/app/problems/[problemNum]/page.tsx b/src/app/problems/[problemNum]/page.tsx index 068690b..46f095d 100644 --- a/src/app/problems/[problemNum]/page.tsx +++ b/src/app/problems/[problemNum]/page.tsx @@ -10,10 +10,11 @@ import { CardHeader, CardTitle, } from "@/components/ui/card" -import { useFetchProblemNum } from "@/hooks"; +import { useFetchProblemNum, useFetchSubmissionCount } from "@/hooks"; import { problemNumSchema } from "@/schema"; import { processProblemNumBarChartData } from "@/utils/dataProcessing"; import ProblemVerdictChart from "@/components/charts/ProblemVerdictChart"; +import SubmissionsOvertimeChart from "@/components/charts/SubmissionsOvertimeChart"; type problemPageProps = { params: z.infer; @@ -27,8 +28,16 @@ const ProblemPage = ({ params }: problemPageProps) => { data: problemNumData, error: problemNumError, } = useFetchProblemNum(params.problemNum); + const { + isLoading: submissionCountIsLoading, + isSuccess: submissionCountIsSuccess, + isError: submissionCountIsError, + data: submissionCountData, + error: submissionCountError, + } = useFetchSubmissionCount(params.problemNum) - if (problemNumIsLoading || !problemNumData || problemNumData.data === undefined) { + if (( problemNumIsLoading || !problemNumData || problemNumData.data === undefined ) || + ( submissionCountIsLoading || !submissionCountData)) { return (

Loading: {params.problemNum}

@@ -68,6 +77,7 @@ const ProblemPage = ({ params }: problemPageProps) => {

Problem page: {params.problemNum}

+ {/* Submission verdicts bar chart */}
@@ -78,8 +88,16 @@ const ProblemPage = ({ params }: problemPageProps) => {
+ {/* Submissions overtime line chart */}
- {/* */} + + + Submissions overtime + + + + +
{/* */}