2024-05-06 11:33:00 +00:00
|
|
|
import React from "react";
|
|
|
|
import { Movie } from "./movie-wall";
|
2024-05-07 16:58:39 +00:00
|
|
|
import tmdb from "./tmdb";
|
2024-05-18 11:59:35 +00:00
|
|
|
import { WhereToWatch } from "./whereToWatch";
|
2024-05-19 15:17:30 +00:00
|
|
|
import CrossfadeImage from 'react-crossfade-image'
|
2024-05-06 11:33:00 +00:00
|
|
|
export interface SidebarProps extends React.ComponentPropsWithRef<"div"> {
|
|
|
|
movie: Movie;
|
2024-05-08 17:35:21 +00:00
|
|
|
similarMoviesAvailable: boolean;
|
2024-05-18 11:59:35 +00:00
|
|
|
watchProviders: {};
|
2024-05-06 11:33:00 +00:00
|
|
|
}
|
2024-05-18 11:59:35 +00:00
|
|
|
export function Sidebar({ movie, similarMoviesAvailable, watchProviders }: SidebarProps) {
|
2024-05-08 14:50:27 +00:00
|
|
|
return <div id="sidebar">
|
2024-05-06 11:33:00 +00:00
|
|
|
<h1>{movie?.title ?? "loading"}</h1>
|
2024-05-22 08:55:28 +00:00
|
|
|
<a href={tmdb.makeMovieLink(movie)} target="_blank" rel="noopener noreferrer">
|
|
|
|
<CrossfadeImage src={tmdb.makeImgUrl(movie.poster_path ?? "")} containerClass="chosen-movie-poster" style={{ objectFit: "cover", height: "100%" }} />
|
|
|
|
</a>
|
|
|
|
{similarMoviesAvailable ? "" : "No hay data suficiente para darte pelílculas relacionadas."}
|
2024-05-18 12:49:21 +00:00
|
|
|
<p id="summary">{movie.overview === null ? "Loading"
|
2024-05-08 17:35:21 +00:00
|
|
|
: movie.overview === "" ? "Resumen no disponible."
|
|
|
|
: movie.overview}
|
|
|
|
</p>
|
2024-05-18 11:59:35 +00:00
|
|
|
<WhereToWatch watchProviders={watchProviders} />
|
2024-05-06 11:33:00 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
}
|