movie-explorer/src/objects/sidebar.tsx

18 lines
486 B
TypeScript
Raw Normal View History

2024-05-06 11:33:00 +00:00
import React from "react";
import { Movie } from "./movie-wall";
export interface SidebarProps extends React.ComponentPropsWithRef<"div"> {
movie: Movie;
}
export function Sidebar({ movie }: SidebarProps) {
const style = {
backgroundImage: "url(https://image.tmdb.org/t/p/w500/" + movie?.poster_path + ")",
backgroundSize: "cover",
}
return <div id="sidebar" style={style}>
<h1>{movie?.title ?? "loading"}</h1>
<p>{movie?.overview ?? "loading"}</p>
</div>
}