File tree Expand file tree Collapse file tree 2 files changed +24
-17
lines changed
Expand file tree Collapse file tree 2 files changed +24
-17
lines changed Original file line number Diff line number Diff line change 22< html class ="dark " lang ="en ">
33 < head >
44 < meta charset ="UTF-8 " />
5- < link rel ="icon " type ="image/svg+xml " href ="/vite.svg " />
65 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
76 < title > web</ title >
87 < style >
Original file line number Diff line number Diff line change @@ -74,14 +74,18 @@ const WatchHome = () => {
7474 >
7575 < ExpandableRow
7676 title = "Movies"
77- items = { moviesData . media . map ( ( item : Media ) => ( {
78- id : item . id ,
79- title : item . title ,
80- year : item . releaseDate
81- ? new Date ( item . releaseDate ) . getFullYear ( )
82- : 0 ,
83- image : item . posterUrl || item . backdropUrl || "" ,
84- } ) ) }
77+ items = {
78+ moviesData ?. media
79+ ?. filter ( ( item : Media ) => item . id && item . title )
80+ . map ( ( item : Media ) => ( {
81+ id : item . id ! ,
82+ title : item . title ! ,
83+ year : item . releaseDate
84+ ? new Date ( item . releaseDate ) . getFullYear ( )
85+ : 0 ,
86+ image : item . posterUrl || item . backdropUrl || "" ,
87+ } ) ) || [ ]
88+ }
8589 onItemClick = { handleItemClick }
8690 />
8791 </ motion . div >
@@ -96,14 +100,18 @@ const WatchHome = () => {
96100 >
97101 < ExpandableRow
98102 title = "TV Shows"
99- items = { tvShowsData . media . map ( ( item : Media ) => ( {
100- id : item . id ,
101- title : item . title ,
102- year : item . releaseDate
103- ? new Date ( item . releaseDate ) . getFullYear ( )
104- : 0 ,
105- image : item . posterUrl || item . backdropUrl || "" ,
106- } ) ) }
103+ items = {
104+ tvShowsData ?. media
105+ ?. filter ( ( item : Media ) => item . id && item . title )
106+ . map ( ( item : Media ) => ( {
107+ id : item . id ! ,
108+ title : item . title ! ,
109+ year : item . releaseDate
110+ ? new Date ( item . releaseDate ) . getFullYear ( )
111+ : 0 ,
112+ image : item . posterUrl || item . backdropUrl || "" ,
113+ } ) ) || [ ]
114+ }
107115 onItemClick = { handleItemClick }
108116 />
109117 </ motion . div >
You can’t perform that action at this time.
0 commit comments