This commit is contained in:
Nikhil Nawgiri 2024-10-27 13:20:58 +01:00
parent 806d72e58a
commit f6b67cfbb2
2 changed files with 2 additions and 3 deletions

View file

@ -8,14 +8,13 @@ const SearchResult = ({ items }: SearchResultProps) => (
<div className="search-result-wrapper">
{items.length > 0 && items.map((item) => {
const { Title, Poster, imdbID, Year, Type } = item;
const yearSanitized = Year.length > 4 ? `${Year.substring(0, 4)}..` : Year;
return (
<SearchResultItem
title={Title}
image={Poster}
imdbId={imdbID}
key={Poster}
year={yearSanitized}
year={Year}
type={Type}
/>
);

View file

@ -27,7 +27,7 @@ const SearchResultItem = ({
<section>
<div className="search-result-item-meta">
<span className="search-result-item-year">
{year}
{year.substring(0, 4)}
</span>
&nbsp;
-