text: (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{40:function(e,a,n){e.exports=n.p+"static/media/logo.ab10d000.png"},49:function(e,a,n){e.exports=n(65)},54:function(e,a,n){},55:function(e,a,n){},65:function(e,a,n){"use strict";n.r(a);var t=n(0),c=n.n(t),l=n(39),r=n.n(l),s=(n(54),n(55),n(40)),m=n.n(s),i=n(48),u=n(18),o=n(22),h=n(23),p=n(28),E=n(24),d=n(29),g=n(25),b=n(16),f=n.n(b),_=n(41),y=n.n(_),N=n(42),v=n.n(N),k=n(17);function w(e){var a=e.launch,n=a.flight_number,t=a.launch_date_local,l=a.launch_success,r=a.mission_name;return c.a.createElement("div",{className:"card card-body mb-3"},c.a.createElement("div",{className:"row"},c.a.createElement("div",{className:"col-md-9"},c.a.createElement("h4",null,"Mission: ",c.a.createElement("span",{className:y()({"text-success":l,"text-danger":!l})},r)),c.a.createElement("p",null,"Date: ",c.a.createElement(v.a,{format:"YYYY-MM-DD HH:mm"},t))),c.a.createElement("div",{className:"col-md-3"},c.a.createElement(k.b,{to:"/launch/".concat(n),className:"btn btn-secondary"},"Launch Details"))))}function j(){return c.a.createElement("div",{className:"my-3"},c.a.createElement("p",null,c.a.createElement("span",{className:"px-3 mr-2 bg-success"})," = Success"),c.a.createElement("p",null,c.a.createElement("span",{className:"px-3 mr-2 bg-danger"})," = Fail"))}function O(){var e=Object(g.a)(["\n  query LaunchesQuery {\n    launches {\n      flight_number\n      mission_name\n      launch_date_local\n      launch_success\n    }\n  }\n"]);return O=function(){return e},e}var x=f()(O()),D=function(e){function a(){return Object(o.a)(this,a),Object(p.a)(this,Object(E.a)(a).apply(this,arguments))}return Object(d.a)(a,e),Object(h.a)(a,[{key:"render",value:function(){return c.a.createElement(t.Fragment,null,c.a.createElement("h1",{className:"display-4 my-3"},"Launches"),c.a.createElement(j,null),c.a.createElement(u.b,{query:x},function(e){var a=e.loading,n=e.error,l=e.data;return a?c.a.createElement("h4",null,"Loading..."):(n&&console.log(n),c.a.createElement(t.Fragment,null,l.launches.map(function(e){return c.a.createElement(w,{key:e.flight_number,launch:e})})))}))}}]),a}(t.Component);function F(){var e=Object(g.a)(["\n  query LaunchQuery($flight_number: Int!) {\n    launch(flight_number: $flight_number) {\n      flight_number\n      mission_name\n      launch_year\n      launch_success\n      rocket {\n        rocket_id\n        rocket_name\n        rocket_type\n      }\n    }\n  }\n"]);return F=function(){return e},e}var L=f()(F()),Y=function(e){function a(){return Object(o.a)(this,a),Object(p.a)(this,Object(E.a)(a).apply(this,arguments))}return Object(d.a)(a,e),Object(h.a)(a,[{key:"render",value:function(){var e=this.props.match.params.flight_number;return e=parseInt(e),c.a.createElement(t.Fragment,null,c.a.createElement(u.b,{query:L,variables:{flight_number:e}},function(e){var a=e.loading,n=e.error,t=e.data;if(a)return c.a.createElement("h4",null,"loading...");n&&console.log(n);var l=t.launch,r=l.flight_number,s=l.mission_name,m=l.launch_year,i=l.launch_success,u=l.rocket,o=u.rocket_id,h=u.rocket_name,p=u.rocket_type;return c.a.createElement("div",null,c.a.createElement("h1",{className:"display-4 my-3"},c.a.createElement("span",{className:"text-dark"},"Mission: ")," ",s),c.a.createElement("h4",{className:"mb-3"},"Launch Details"),c.a.createElement("ul",{className:"list-group"},c.a.createElement("li",{className:"list-group-item"},"Flight Number: ",r),c.a.createElement("li",{className:"list-group-item"},"Flight Year: ",m),c.a.createElement("li",{className:"list-group-item"},"Flight Successful: ",i?"Yes":"No")),c.a.createElement("h4",{className:"mb-3"},"Rocket Details"),c.a.createElement("ul",{className:"list-group"},c.a.createElement("li",{className:"list-group-item"},"Rocket ID: ",o),c.a.createElement("li",{className:"list-group-item"},"Rocket Name: ",h),c.a.createElement("li",{className:"list-group-item"},"Rocket Type: ",p)),c.a.createElement("hr",null),c.a.createElement(k.b,{to:"/",className:"btn btn-secondary"},"Back"))}))}}]),a}(t.Component),q=n(14),I=new i.a({uri:"/graphql"});var M=function(){return c.a.createElement(u.a,{client:I},c.a.createElement(k.a,null,c.a.createElement("div",{className:"container"},c.a.createElement("img",{src:m.a,alt:"Spacex",style:{width:300,display:"block",margin:"auto"}}),c.a.createElement(q.a,{exact:!0,path:"/",component:D}),c.a.createElement(q.a,{exact:!0,path:"/launch/:flight_number",component:Y}))))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));r.a.render(c.a.createElement(M,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})}},[[49,1,2]]]);
  //# sourceMappingURL=main.da14a6ea.chunk.js.map