File tree Expand file tree Collapse file tree
apps/web/src/features/Application/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useTheme } from "@/components/ThemeProvider";
33import { useMemo } from "react" ;
44
55interface SubmissionsChartProps {
6- submission_stats : {
6+ submission_stats ? : {
77 count : number ;
88 day : string ;
99 } [ ] ;
@@ -20,16 +20,18 @@ export default function SubmissionsChart({
2020 const labels : string [ ] = [ ] ;
2121 const values : number [ ] = [ ] ;
2222
23- for ( const submission of submission_stats ) {
24- labels . push (
25- new Date ( submission . day ) . toLocaleDateString ( undefined , {
26- weekday : "narrow" ,
27- month : "short" ,
28- day : "numeric" ,
29- timeZone : "UTC" ,
30- } ) ,
31- ) ;
32- values . push ( submission . count ) ;
23+ if ( submission_stats ) {
24+ for ( const submission of submission_stats ) {
25+ labels . push (
26+ new Date ( submission . day ) . toLocaleDateString ( undefined , {
27+ weekday : "narrow" ,
28+ month : "short" ,
29+ day : "numeric" ,
30+ timeZone : "UTC" ,
31+ } ) ,
32+ ) ;
33+ values . push ( submission . count ) ;
34+ }
3335 }
3436
3537 return { labels, values } ;
You can’t perform that action at this time.
0 commit comments