text: (this["webpackJsonpemployee-directory"]=this["webpackJsonpemployee-directory"]||[]).push([[0],{22:function(e,t,c){},23:function(e,t,c){},44:function(e,t,c){"use strict";c.r(t);var s=c(2),n=c(16),a=c.n(n),r=(c(22),c(23),c(0)),i=function(){return Object(r.jsx)("div",{className:"container-fluid headerContainer",children:Object(r.jsx)("div",{id:"header",className:"pt-5 pb-3 text-center block block-2",children:Object(r.jsx)("h1",{className:"mb-5",children:"Company Employee Directory"})})})},o=c(7),l=c(5),j=c(17),d=c.n(j),m=c.p+"static/media/arrow-up.fb1aab50.svg",h=c.p+"static/media/arrow-down.50a1011d.svg",u=function(){var e=Object(s.useState)([]),t=Object(l.a)(e,2),c=t[0],n=t[1],a=Object(s.useState)([]),i=Object(l.a)(a,2),j=i[0],u=i[1],b=Object(s.useState)(""),p=Object(l.a)(b,2),O=p[0],x=p[1];Object(s.useEffect)((function(){d.a.get("https://randomuser.me/api/?results=50&nat=us").then((function(e){n(e.data.results),u(e.data.results)}))}),[]);var f=function(e,t){var c=e.name.first.toUpperCase(),s=t.name.first.toUpperCase();return c<s?-1:c>s?1:0},g=function(e,t){var c=e.name.first.toUpperCase(),s=t.name.first.toUpperCase();return c<s?1:c>s?-1:0};return Object(r.jsx)("div",{className:"container mt-5 mainContainer",children:Object(r.jsxs)("div",{className:"card ",children:[Object(r.jsx)("form",{className:"form mt-5 ",children:Object(r.jsx)("input",{className:"form-control w-25 mx-auto shadow-lg text-center",type:"search",placeholder:"Search Employee",name:"search",onChange:function(e){var t=e.target.value;if(x(t),O){var s=c.filter((function(e){return e.name.first.includes(t)||e.name.last.includes(t)||e.email.includes(t)}));u(s)}else u(c)},value:O})}),Object(r.jsxs)("table",{className:"table mt-5",children:[Object(r.jsx)("thead",{className:"thead-dark",children:Object(r.jsxs)("tr",{children:[Object(r.jsx)("th",{scope:"col",children:" "}),Object(r.jsxs)("th",{scope:"col",children:["First Name",Object(r.jsx)("img",{className:"sort",src:m,style:{height:"auto",width:"20px",margin:"5px"},onClick:function(){var e=Object(o.a)(j).sort(f);console.log(e),u(e)},alt:"UpArrow"}),Object(r.jsx)("img",{className:"sort",src:h,style:{height:"22px",width:"auto",margin:"5px"},onClick:function(){var e=Object(o.a)(j).sort(g);console.log(e),u(e)},alt:"DownArrow"})]}),Object(r.jsx)("th",{scope:"col",children:"Last Name"}),Object(r.jsx)("th",{scope:"col",children:"Email Address"}),Object(r.jsx)("th",{scope:"col",children:"Phone Number"})]})}),Object(r.jsx)("tbody",{className:"ml-5",children:j.map((function(e){return Object(r.jsxs)("tr",{children:[Object(r.jsxs)("th",{scope:"row ",children:[" ",Object(r.jsx)("img",{src:e.picture.medium,alt:""})," "]}),Object(r.jsx)("td",{children:e.name.first}),Object(r.jsx)("td",{children:e.name.last}),Object(r.jsx)("td",{children:e.email}),Object(r.jsx)("td",{children:e.phone})]},e.login.uuid)}))})]})]})})};var b=function(){return Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)(i,{}),Object(r.jsx)(u,{})]})},p=function(e){e&&e instanceof Function&&c.e(3).then(c.bind(null,45)).then((function(t){var c=t.getCLS,s=t.getFID,n=t.getFCP,a=t.getLCP,r=t.getTTFB;c(e),s(e),n(e),a(e),r(e)}))};c(43);a.a.render(Object(r.jsx)(b,{}),document.getElementById("root")),p()}},[[44,1,2]]]);
  //# sourceMappingURL=main.0eba4dc0.chunk.js.map