movie-explorer/src/objects/sidebar.tsx

18 lines
462 B
TypeScript
Raw Normal View History

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-06 11:33:00 +00:00
export interface SidebarProps extends React.ComponentPropsWithRef<"div"> {
movie: Movie;
}
export function Sidebar({ movie }: SidebarProps) {
const style = {
2024-05-07 16:58:39 +00:00
backgroundImage: tmdb.makeBgImgUrl(movie.backdrop_path ?? "")
2024-05-06 11:33:00 +00:00
}
return <div id="sidebar" style={style}>
<h1>{movie?.title ?? "loading"}</h1>
<p>{movie?.overview ?? "loading"}</p>
</div>
}