text: (this.webpackJsonppracticeapp=this.webpackJsonppracticeapp||[]).push([[0],[,,,,function(e){e.exports=JSON.parse('[{"id":1,"name":"Benjamin Franklin Pierce","image":"https://m.media-amazon.com/images/M/MV5BMTUxMzI0NDM1NF5BMl5BanBnXkFtZTYwMjQ3NzEz._V1_UX100_CR0,0,100,100_AL_.jpg","rank":"Captain","phone":"(555) 123-4567","email":"hawkeye@mash.gov","dob":"01/28/1936"},{"id":2,"name":"BJ Hunnicutt","image":"https://m.media-amazon.com/images/M/MV5BMTY3NTU1NzM2N15BMl5BanBnXkFtZTYwNjQ3NzEz._V1_UX100_CR0,0,100,100_AL_.jpg","rank":"Captain","phone":"(393) 667-1178","email":"hunnicutt@mash.gov","dob":"02/06/1939"},{"id":3,"name":"Margaret J Houlihan","image":"https://m.media-amazon.com/images/M/MV5BMjA1MzMxNDQ5MV5BMl5BanBnXkFtZTgwMTI2MDY5MDI@._V1_UX100_CR0,0,100,100_AL_.jpg","rank":"Major","phone":"(079) 561-4028","email":"hotlips@mash.gov","dob":"11/04/1937"},{"id":4,"name":"Charles Emerson Winchester III","image":"https://m.media-amazon.com/images/M/MV5BOTYyMmQ2N2ItODA5Zi00MTU1LWJjMGUtNTdiZDk5NmY2MmJkXkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR24,0,100,100_AL_.jpg","rank":"Major","phone":"(650) 274-2412","email":"winchester@mash.gov","dob":"10/31/1942"},{"id":5,"name":"Sherman Tecumseh Potter","image":"https://m.media-amazon.com/images/M/MV5BMTk4OTc3NzE5MF5BMl5BanBnXkFtZTcwMTc4NDMxNw@@._V1_UX100_CR0,0,100,100_AL_.jpg","rank":"Colonel","phone":"(959) 248-9895","email":"mildred@mash.gov","dob":"04/10/1915"},{"id":6,"name":"Walter Eugene O\'Reilly","image":"https://m.media-amazon.com/images/M/MV5BMTk1NDY1ODIyNl5BMl5BanBnXkFtZTYwMTg1NDU2._V1_UX100_CR0,0,100,100_AL_.jpg","rank":"Corporel","phone":"(754) 307-8800","email":"radar@mash.gov","dob":"05/24/1943"},{"id":7,"name":"Francis John Patrick Mulcahy","image":"https://m.media-amazon.com/images/M/MV5BYjFmYTQ2NTgtMDE5My00NDRhLTk2OGYtODljODdmYmI2N2FiXkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR24,0,100,100_AL_.jpg","rank":"Father","phone":"(351) 215-3642","email":"heaven@mash.gov","dob":"10/20/1932"},{"id":8,"name":"Maxwell Q. Klinger","image":"https://m.media-amazon.com/images/M/MV5BZjIxMTE1OTItMTcwZS00Y2E4LTlhMmItYzA5ZTdkMzBiNDdlXkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR25,0,100,100_AL_.jpg","rank":"Corporel","phone":"(069) 885-2055","email":"toledo@mash.gov","dob":"07/01/1934"},{"id":9,"name":"Kealani Kellye","image":"https://m.media-amazon.com/images/M/MV5BZGEzMTU0NjktZTA4YS00NjI1LWI1N2EtYzA5NzgxZjZmZDRlXkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR16,0,100,100_AL_.jpg","rank":"First Lieutenant","phone":"(064) 682-7339","email":"kellye@mash.gov","dob":"01/16/1948"},{"id":10,"name":"Franklin Delano Marion Burns","image":"https://m.media-amazon.com/images/M/MV5BMjdkY2NkY2ItMjU0ZS00NWRmLTgxNjUtOTY1NTgzMmI0NWY1XkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR24,0,100,100_AL_.jpg","rank":"Major","phone":"(027) 619-3720","email":"burns@mash.gov","dob":"09/29/1939"},{"id":11,"name":"John Francis Xavier MacEntyre","image":"https://m.media-amazon.com/images/M/MV5BYTNhMjc1OTYtYWM2MC00MWE3LTljMGMtYzZmODgzNmI5ZDVkXkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR16,0,100,100_AL_.jpg","rank":"Captain","phone":"(592) 086-7112","email":"trapper@mash.gov","dob":"04/07/1933"},{"id":12,"name":"Henry Braymore Blake","image":"https://m.media-amazon.com/images/M/MV5BMmUyOTc0ZDktYzNiMy00N2MyLWE4YTktNmM3NDc5ZjZiYjIxXkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR16,0,100,100_AL_.jpg","rank":"Lieutenant Colonel","phone":"(625) 259-5513","email":"blake@mash.gov","dob":"11/14/1927"},{"id":13,"name":"Luther Wilson Rizzo","image":"https://m.media-amazon.com/images/M/MV5BYjkyMzIzZGItMWQzMC00NDFjLWFkZGUtYjNkZDQ2Nzk3NGE2XkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR25,0,100,100_AL_.jpg","rank":"Sargeant","phone":"(505) 292-9532","email":"motorpool@mash.gov","dob":"08/27/1944"},{"id":14,"name":"Oliver Harmon Jones","image":"https://m.media-amazon.com/images/M/MV5BMjkzZjJiODYtOGY2YS00NzJhLWE1MDItYWI3MjM4ZDJmZTgyXkEyXkFqcGdeQXVyMDgyNjA5MA@@._V1_UY100_CR16,0,100,100_AL_.jpg","rank":"Captain","phone":"(482) 377-5174","email":"spearchucker@mash.gov","dob":"05/24/1937"}]')},function(e,a,t){},,,,,,,,,,,function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){},function(e,a,t){"use strict";t.r(a);var n=t(0),i=t(1),o=t(6),r=t.n(o);t(16);var m=function(){return Object(n.jsx)("h1",{className:"title",children:"Employee Directory"})},c=t(3),s=t(7),l=t(8),h=t(10),j=t(9);t(17);var d=function(e){return Object(n.jsx)("div",{id:"searchbox",children:Object(n.jsxs)("div",{className:"form-row",children:[Object(n.jsx)("div",{className:"col sm-9",children:Object(n.jsx)("input",{type:"search",onChange:e.handleInputChange,value:e.search,className:"form-control",name:"search",id:"searchFilter",placeholder:"Search Employee"})}),Object(n.jsx)("div",{className:"col sm-3",children:Object(n.jsx)("button",{type:"button",onClick:e.sortDirection,name:"sort",children:"Sort"})})]})})},M=t(4);t(18);var g=function(e){return Object(n.jsx)(n.Fragment,{children:Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{children:Object(n.jsx)("img",{alt:e.name,src:e.image})}),Object(n.jsx)("td",{children:e.name}),Object(n.jsx)("td",{children:e.rank}),Object(n.jsx)("td",{children:e.phone}),Object(n.jsx)("td",{children:e.email}),Object(n.jsx)("td",{children:e.dob})]})})},p=(t(5),function(e){Object(h.a)(t,e);var a=Object(j.a)(t);function t(){var e;Object(s.a)(this,t);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return(e=a.call.apply(a,[this].concat(i))).state={employeeList:M,filteredList:M,search:"",sortDirection:"ASC"},e.sortDirection=function(){console.log("sort");var a=e.state.filteredList.sort((function(e,a){var t=e.name.toLowerCase(),n=a.name.toLowerCase();return t<n?-1:t>n?1:0}));console.log(a);var t="";"ASC"===e.state.sortDirection?t="DESC":(t="ASC",a.reverse()),console.log(a),console.log(t),e.setState({filteredList:a,sortDirection:t})},e.handleInputChange=function(a){var t;a.preventDefault();var n=a.target,i=n.value,o=n.name,r=e.state.employeeList.filter((function(e){return e.name.indexOf(i)>-1}));console.log(r),e.setState((t={},Object(c.a)(t,o,i),Object(c.a)(t,"filteredList",r),t))},e}return Object(l.a)(t,[{key:"render",value:function(){return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(d,{name:"search",handleInputChange:this.handleInputChange,value:this.state.search,sortDirection:this.sortDirection}),Object(n.jsxs)("table",{className:"table",children:[Object(n.jsx)("thead",{className:"theader",children:Object(n.jsxs)("tr",{children:[Object(n.jsx)("th",{scope:"col",children:"Photo"}),Object(n.jsx)("th",{scope:"col",children:"Name"}),Object(n.jsx)("th",{scope:"col",children:"Rank"}),Object(n.jsx)("th",{scope:"col",children:"Phone Number"}),Object(n.jsx)("th",{scope:"col",children:"e-mail Address"}),Object(n.jsx)("th",{scope:"col",children:"Date of Birth"})]})}),Object(n.jsx)("tbody",{children:this.state.filteredList.map((function(e){return Object(n.jsx)(g,{id:e.id,image:e.image,name:e.name,rank:e.rank,phone:e.phone,email:e.email,dob:e.dob},e.id)}))})]})]})}}]),t}(i.Component));t(19);var b=function(){return Object(n.jsx)("footer",{children:Object(n.jsx)("p",{children:"Copyright \xa9 2020"})})};var k=function(){return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(m,{}),Object(n.jsx)(p,{}),Object(n.jsx)(b,{})]})};r.a.render(Object(n.jsx)(k,{}),document.getElementById("root"))}],[[20,1,2]]]);
  //# sourceMappingURL=main.a09168c3.chunk.js.map