diff --git a/src/pages/Detail.js b/src/pages/Detail.js index b19d52c..51106fb 100644 --- a/src/pages/Detail.js +++ b/src/pages/Detail.js @@ -1,22 +1,76 @@ import Row from 'react-bootstrap/Row'; import Col from 'react-bootstrap/Col'; +import Form from 'react-bootstrap/Form'; import Container from "react-bootstrap/Container"; - +import { useState, useEffect } from 'react'; import { useParams } from 'react-router-dom'; +import { ItemImage } from '../components/ItemImage'; +import Button from 'react-bootstrap/Button'; export function Detail(props) { + const [movieData, setBookData] = useState() + let { id } = useParams(); - return( - - - - Image - - - Details - {id} - - - - ) -} \ No newline at end of file + + useEffect(() => { + if (!movieData) { + props.handler(id).then((movie) => setMovieData(movie)) + } + }, [id]); + + if (movieData) { + return ( + + + + {movieData.movie_title} + + + + + + + + More information + Summary + {movieData.summary} + Author + {movieData.author} + ISBN + ISBN10: {movieData.isbn10} + ISBN13: {movieData.isbn13} + + Review this movie + + Star + + 1 + 2 + 3 + 4 + 5 + + + + Title + + + + Review + + + Submit + + + + + + + + ) + } + else { + return null + } + +}
{id}
{movieData.summary}
{movieData.author}
ISBN10: {movieData.isbn10}
ISBN13: {movieData.isbn13}