Add placeholder for actor image

This commit is contained in:
“Henry-Hiles” 2022-11-14 11:44:25 -05:00
parent e5f0d47862
commit 1fe6533db5
3 changed files with 61 additions and 8 deletions

View file

@ -132,14 +132,14 @@ const Movie = () => {
to={`/actor/${actor.id}`}
className={styles.Actor}
>
{actor.profile_path ? (
<img
src={`https://image.tmdb.org/t/p/w200${actor.profile_path}`}
alt={actor.name}
/>
) : (
<p>Image Unavailable</p>
)}
<img
src={
actor.profile_path
? `https://image.tmdb.org/t/p/w200${actor.profile_path}`
: "../placeholder.svg" //`https://ui-avatars.com/api/?name=${encodeURIComponent(actor.name)}&size=300`
}
alt={actor.name}
/>
<h3>{actor.name}</h3>
</Link>