text: (this["webpackJsonpgoit-react-hw-04-movies"]=this["webpackJsonpgoit-react-hw-04-movies"]||[]).push([[6],{100:function(e,t,n){e.exports={clearLink:"MovieDetailsPage_clearLink__2GRmH",btn:"MovieDetailsPage_btn__3DMYX",mainSection:"MovieDetailsPage_mainSection__BOh1F",mainImage:"MovieDetailsPage_mainImage__10OFU",list:"MovieDetailsPage_list__2ZOTm"}},105:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return p}));var a=n(55),c=n.n(a),i=n(56),r=n(54),s=n(3),o=n(9),l=n(0),u=n(53),d=n(10),j=n(15),b=n.n(j),v=n(100),h=n.n(v),m=n(1),O=Object(l.lazy)((function(){return n.e(7).then(n.bind(null,107))})),f=Object(l.lazy)((function(){return n.e(8).then(n.bind(null,108))})),p=function(){var e=Object(s.g)(),t=Object(s.i)(),n=Object(s.h)(),a=Object(l.useState)(),j=Object(r.a)(a,2),v=j[0],p=j[1],g=Object(l.useState)(),x=Object(r.a)(g,2),_=(x[0],x[1]);Object(l.useEffect)((function(){(function(){var e=Object(i.a)(c.a.mark((function e(){var n,a;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(u.d)(t.movieId);case 3:n=e.sent,a=n.data,p(a),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),_(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}})()()}),[]);return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)("button",{type:"button",className:h.a.btn,onClick:function(){var t;if(null===n||void 0===n||null===(t=n.state)||void 0===t?void 0:t.from){var a=n.state.from;e.push(a)}else e.push(d.a.HOME_PAGE)},children:"\u25c0 Go back"}),Object(m.jsxs)("section",{className:h.a.mainSection,children:[Object(m.jsx)("img",{src:v&&"".concat("https://image.tmdb.org/t/p/w500").concat(null===v||void 0===v?void 0:v.backdrop_path),alt:"",className:h.a.mainImage}),Object(m.jsxs)("div",{children:[Object(m.jsx)("h1",{children:null===v||void 0===v?void 0:v.title}),Object(m.jsxs)("p",{children:["User score: ",[10*(null===v||void 0===v?void 0:v.vote_average)],"%"]}),Object(m.jsx)("h3",{children:"Overview"}),Object(m.jsx)("p",{children:null===v||void 0===v?void 0:v.overview}),Object(m.jsx)("h4",{children:"Genres"}),Object(m.jsx)("p",{children:null===v||void 0===v?void 0:v.genres.map((function(e){var t=e.id,n=e.name;return Object(m.jsxs)("span",{children:[n," "]},t)}))})]})]}),Object(m.jsx)("hr",{}),Object(m.jsxs)("section",{children:[Object(m.jsx)("h4",{children:"Additional information"}),Object(m.jsxs)("ul",{className:h.a.list,children:[Object(m.jsx)("li",{children:Object(m.jsx)(o.b,{to:{pathname:"/movies/".concat(t.movieId,"/cast"),state:{from:null===n||void 0===n?void 0:n.state.from}},className:h.a.clearLink,children:"Casts"})}),Object(m.jsx)("li",{children:Object(m.jsx)(o.b,{to:{pathname:"/movies/".concat(t.movieId,"/reviews"),state:{from:null===n||void 0===n?void 0:n.state.from}},className:h.a.clearLink,children:"Reviews"})})]})]}),Object(m.jsx)("hr",{}),Object(m.jsxs)(l.Suspense,{fallback:Object(m.jsx)(b.a,{className:"Loader",type:"TailSpin",color:"#3f51b5",height:50,width:50,timeout:0}),children:[Object(m.jsx)(s.b,{path:"".concat(d.a.MOVIE_DATAILS_PAGE,"/cast"),exact:!0,render:function(){return Object(m.jsx)(O,{title:"Cast",id:t.movieId})}}),Object(m.jsx)(s.b,{path:"".concat(d.a.MOVIE_DATAILS_PAGE,"/reviews"),exact:!0,render:function(){return Object(m.jsx)(f,{title:"Reviews",id:t.movieId})}})]})]})}},53:function(e,t,n){"use strict";n.d(t,"e",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return l}));var a=n(60),c=n.n(a);c.a.defaults.baseURL="https://api.themoviedb.org/3",c.a.defaults.params={api_key:"92328ae8dd5bcee1597a295c993c895b"};var i=function(){return c.a.get("/trending/movie/day")},r=function(e){return c.a.get("/movie/".concat(e,"?language=en-US"))},s=function(e){return c.a.get("/search/movie?language=en-US&query=".concat(e,"&page=1&include_adult=false"))},o=function(e){return c.a.get("/movie/".concat(e,"/credits?language=en-US"))},l=function(e){return c.a.get("/movie/".concat(e,"/reviews?language=en-US&page=1"))}}}]);
  //# sourceMappingURL=6.5df5a3b3.chunk.js.map