Refactor MovieCard props in SearchList: streamline prop passing by spreading result object and joining genre_ids for improved readability and maintainability.
This commit is contained in:
		
							parent
							
								
									403f394924
								
							
						
					
					
						commit
						83e931c27f
					
				|  | @ -47,14 +47,10 @@ export const SearchList: FC<Props> = ({ query }) => { | ||||||
|         <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6 mt-8"> |         <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6 mt-8"> | ||||||
|           {results?.map((result) => ( |           {results?.map((result) => ( | ||||||
|             <MovieCard |             <MovieCard | ||||||
|               layout="zeus" |  | ||||||
|               key={result.id} |               key={result.id} | ||||||
|               id={result.id} |               layout="zeus" | ||||||
|               title={result.title} |               {...result} | ||||||
|               releaseDate={result.release_date} |               genre_ids={result.genre_ids.join(",")} | ||||||
|               popularity={result.popularity} |  | ||||||
|               overview={result.overview} |  | ||||||
|               imagePath={result.poster_path} |  | ||||||
|               seen={false} |               seen={false} | ||||||
|               favorite={false} |               favorite={false} | ||||||
|             /> |             /> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue