text: (this.webpackJsonphomepage=this.webpackJsonphomepage||[]).push([[0],{36:function(e,t,r){},42:function(e,t,r){},62:function(e,t,r){"use strict";r.r(t);var c=r(1),s=r(0),n=r.n(s),a=r(28),i=r.n(a),l=(r(36),r(11)),j=r(3),d=r(63),o=r(64),b=function(e){var t=e.users;return Object(c.jsx)(c.Fragment,{children:t&&t.map((function(e){return Object(c.jsx)(d.a,{style:{width:"240px",height:"auto",margin:"20px",textAlign:"left",fontFamily:"Arial",background:"orange",fontSize:"10px"},children:Object(c.jsxs)(d.a.Body,{className:"flex-col",children:[Object(c.jsx)(d.a.Title,{children:e.name}),Object(c.jsx)(d.a.Title,{children:e.brewery_type}),Object(c.jsx)(d.a.Title,{children:e.city}),Object(c.jsx)(l.b,{to:"/users/".concat(e.id),children:Object(c.jsx)(o.a,{className:"button",style:{width:"80%",marginTop:"1rem"},children:"More Details"})})]})},e.id)}))})},u=(r(42),r(17)),h=r(30),x=r.n(h),O=function(){var e=Object(s.useState)([]),t=Object(u.a)(e,2),r=t[0],c=t[1],n=Object(s.useState)(""),a=Object(u.a)(n,2),i=a[0],l=a[1];return Object(s.useEffect)((function(){var e=x.a.get("https://api.openbrewerydb.org/breweries").then((function(e){return c(e.data)})).catch((function(e){l(e)}));return function(){e()}}),[]),{users:r,error:i}};r(61);var m=function(e){var t=e.users,r=Object(j.e)().id;return Number(r),Object(c.jsx)(c.Fragment,{children:Object(c.jsxs)(d.a,{className:"user-details",style:{alignItems:"center",color:"black",background:"orange",fontFamily:"Arial"},children:[t.filter((function(e){return e.id===r})).map((function(e){return Object(c.jsxs)(d.a.Body,{className:"mt-10",style:{alignItems:"center"},children:[Object(c.jsxs)(d.a.Title,{children:["- name: ",e.name]}),Object(c.jsxs)(d.a.Title,{children:["- brewery_type: ",e.brewery_type]}),Object(c.jsxs)(d.a.Title,{children:["- street: ",e.street]}),Object(c.jsxs)(d.a.Title,{children:["- address_2: ",e.address_2]}),Object(c.jsxs)(d.a.Title,{children:["- address_3: ",e.address_3]}),Object(c.jsxs)(d.a.Title,{children:["- city: ",e.city]}),Object(c.jsxs)(d.a.Title,{children:["- state: ",e.state]}),Object(c.jsxs)(d.a.Title,{children:["- county_province: ",e.county_province]}),Object(c.jsxs)(d.a.Title,{children:["- postal_code: ",e.postal_code]})]})})),Object(c.jsx)(l.b,{to:"/",children:Object(c.jsx)(o.a,{className:"button",style:{marginTop:"1rem",marginBottom:"2rem"},children:"Go Back"})})]},t.id)})},p=function(e){return Object(c.jsx)("div",{class:"alert alert-danger",role:"alert",children:e})};var f=function(){var e=O(),t=e.users,r=e.error;return Object(c.jsxs)("div",{className:"App",children:[Object(c.jsxs)("form",{className:"myInput",children:[Object(c.jsx)("input",{type:"text",placeholder:"Search..",className:"Input",name:"search"}),Object(c.jsx)(o.a,{className:"button",children:"Search"})]}),Object(c.jsx)(l.a,{children:r?Object(c.jsx)(p,{error:r}):Object(c.jsxs)("div",{className:"container",children:[Object(c.jsx)(j.a,{exact:!0,path:"/",children:Object(c.jsx)(b,{users:t})}),Object(c.jsx)(j.a,{path:"/users/:id",children:Object(c.jsx)(m,{users:t})})]})})]})};i.a.render(Object(c.jsx)(n.a.StrictMode,{children:Object(c.jsx)(f,{})}),document.getElementById("root"))}},[[62,1,2]]]);
  //# sourceMappingURL=main.9a7c68cf.chunk.js.map