11import React from 'react' ;
22import Loader from 'react-loader-spinner' ;
33import { LintErrorDTO } from '../../api/dto/lint-error.dto' ;
4+ import { SubmissionDTO } from './submission.dto' ;
45interface LayoutProps {
56 status : string ;
67 message : string ;
@@ -15,6 +16,7 @@ interface LayoutProps {
1516 lintErrors ?: LintErrorDTO [ ] ;
1617 isLoading : boolean ;
1718 maxCyclomaticComplexity ?: number ;
19+ duplicatedSubmissions ?: SubmissionDTO [ ] ;
1820}
1921
2022const Result : React . FC < LayoutProps > = ( {
@@ -31,6 +33,7 @@ const Result: React.FC<LayoutProps> = ({
3133 isLoading,
3234 cyclomaticComplexity,
3335 maxCyclomaticComplexity,
36+ duplicatedSubmissions,
3437} ) => {
3538 if ( status !== 'done' && status !== 'failed' ) {
3639 return (
@@ -56,6 +59,7 @@ const Result: React.FC<LayoutProps> = ({
5659 execDuration = { execDuration }
5760 cyclomaticComplexity = { cyclomaticComplexity }
5861 maxCyclomaticComplexity = { maxCyclomaticComplexity }
62+ duplicatedSubmissions = { duplicatedSubmissions }
5963 />
6064 </ div >
6165 < div className = "w-3/5 pl-6" >
@@ -143,6 +147,7 @@ interface ScoresComponentProps {
143147 execDuration : number | undefined ;
144148 cyclomaticComplexity : number | undefined ;
145149 maxCyclomaticComplexity : number | undefined ;
150+ duplicatedSubmissions : SubmissionDTO [ ] | undefined ;
146151}
147152
148153const ScoresComponent : React . FC < ScoresComponentProps > = ( {
@@ -153,6 +158,7 @@ const ScoresComponent: React.FC<ScoresComponentProps> = ({
153158 execDuration,
154159 cyclomaticComplexity,
155160 maxCyclomaticComplexity,
161+ duplicatedSubmissions,
156162} ) => {
157163 return (
158164 < div className = "relative flex flex-col min-w-0 mb-4 lg:mb-0 break-words bg-gray-50 dark:bg-gray-800 w-full shadow-lg rounded" >
@@ -251,6 +257,18 @@ const ScoresComponent: React.FC<ScoresComponentProps> = ({
251257 </ div >
252258 </ td >
253259 </ tr >
260+ < tr className = "text-gray-700 dark:text-gray-100" >
261+ < th className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-sm whitespace-nowrap p-3 text-left" >
262+ Duplicate submissions
263+ </ th >
264+ < td className = "border-t-0 px-4 align-middle border-l-0 border-r-0 text-sm whitespace-nowrap p-3" >
265+ < div className = "flex items-center" >
266+ < span className = "mr-2" >
267+ { duplicatedSubmissions ?. length } { ' ' }
268+ </ span >
269+ </ div >
270+ </ td >
271+ </ tr >
254272 </ tbody >
255273 </ table >
256274 </ div >
0 commit comments