text: (this.webpackJsonpmern=this.webpackJsonpmern||[]).push([[0],{14:function(e,n,t){e.exports=t.p+"static/media/logo.495d93cc.svg"},15:function(e,n,t){e.exports=t(43)},20:function(e,n,t){},21:function(e,n,t){},22:function(e,n,t){},41:function(e,n,t){},43:function(e,n,t){"use strict";t.r(n);var a=t(0),r=t.n(a),o=t(13),c=t.n(o),l=(t(20),t(14)),i=t.n(l),s=(t(21),t(3));var u=function(e){var n=e.children;return r.a.createElement("div",{style:{height:300,clear:"both",paddingTop:120,textAlign:"center"},className:"jumbotron"},n)};t(22);var m=function(e){return r.a.createElement("span",Object.assign({className:"delete-btn"},e,{role:"button",tabIndex:"0"}),"\u2717")},d=t(2),f=t.n(d),h=function(e){return f.a.get("https://www.googleapis.com/books/v1/volumes?q=$"+e)};function v(e){var n=e.fluid,t=e.children;return r.a.createElement("div",{className:"container".concat(n?"-fluid":"")},t)}function g(e){var n=e.fluid,t=e.children;return r.a.createElement("div",{className:"row".concat(n?"-fluid":"")},t)}function E(e){var n=e.size,t=e.children;return r.a.createElement("div",{className:n.split(" ").map((function(e){return"col-"+e})).join(" ")},t)}t(41);function p(e){var n=e.children;return r.a.createElement("div",{className:"list-overflow-container"},r.a.createElement("ul",{className:"list-group"},n))}function w(e){var n=e.children;return r.a.createElement("li",{className:"list-group-item"},n)}function b(e){return r.a.createElement("div",{className:"form-group"},r.a.createElement("input",{className:"form-control",onChange:e.handleInputChange}))}var N=function(){var e=Object(a.useState)([]),n=Object(s.a)(e,2),t=n[0],o=n[1],c=Object(a.useState)({}),l=Object(s.a)(c,2);return l[0],l[1],Object(a.useEffect)((function(){h("attila").then((function(e){return o(e.data.items)})).catch((function(e){return console.log(e)}))}),[]),r.a.createElement(v,{fluid:!0},r.a.createElement(g,null,r.a.createElement(E,{size:"md-6"},r.a.createElement(u,null,r.a.createElement("h1",null,"What Books Should I Read?")),r.a.createElement("form",null,r.a.createElement(b,{handleInputChange:function(e){return function(e){var n=e.target.value.trim();console.log(">> q",n),h(n).then((function(e){console.log("res.data.items",e.data.items),o(e.data.items)})).catch((function(e){return console.log(e)}))}(e)},name:"title",placeholder:"Title (required)"}))),r.a.createElement(E,{size:"md-6 sm-12"},r.a.createElement(u,null,r.a.createElement("h1",null,"Books On My List")),t.length?r.a.createElement(p,null,t.map((function(e,n){return r.a.createElement(w,{key:n},r.a.createElement("a",{href:"/books/"+e._id},r.a.createElement("strong",null,e.volumeInfo.title," by ",e.author)),r.a.createElement(m,{onClick:function(){}}))}))):r.a.createElement("h3",null,"No Results to Display"))))};var k=function(){return r.a.createElement("nav",{className:"navbar navbar-expand-lg navbar-dark bg-primary"},r.a.createElement("a",{className:"navbar-brand",href:"/"},"React Reading List"))};var j=function(){return r.a.createElement("div",{className:"App"},r.a.createElement("div",{className:"App-header"},r.a.createElement("img",{src:i.a,className:"App-logo",alt:"logo"}),r.a.createElement("h2",null,"Welcome to React")),r.a.createElement(k,null),r.a.createElement(N,null))},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}$/));function O(e){navigator.serviceWorker.register(e).then((function(e){e.onupdatefound=function(){var n=e.installing;n.onstatechange=function(){"installed"===n.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}})).catch((function(e){console.error("Error during service worker registration:",e)}))}t(42);c.a.render(r.a.createElement(j,null),document.getElementById("root")),function(){if("serviceWorker"in navigator){if(new URL("",window.location).origin!==window.location.origin)return;window.addEventListener("load",(function(){var e="".concat("","/service-worker.js");y?function(e){fetch(e).then((function(n){404===n.status||-1===n.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then((function(e){e.unregister().then((function(){window.location.reload()}))})):O(e)})).catch((function(){console.log("No internet connection found. App is running in offline mode.")}))}(e):O(e)}))}}()}},[[15,1,2]]]);
  //# sourceMappingURL=main.98709b3d.chunk.js.map