(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{TsDr:function(e,r,t){"use strict";t.r(r);var n=t("q1tI"),a=t.n(n),o=t("yE/o"),i=t("gaPq"),c=t("h4VS"),l=t("wx14"),u=t("lTCR"),s=t.n(u),d=t("ikXu"),f=t("D1pA"),p=t("YFqc"),h=t.n(p),b=t("YRLc"),O=a.a.createElement;function m(){var e=Object(c.a)(["\n    query currencies($limit: Int, $offset: Int) {\n      currencies(limit: $limit, offset: $offset, includeInactive: true) {\n        _id\n        isoCode\n        isActive\n      }\n    }\n  "]);return m=function(){return e},e}var w=Object(b.b)({queryName:"currencies",query:s()(m())})((function(e){var r=Object(l.a)({},e);return O(b.a,Object(l.a)({},r,{cols:2,createPath:"/currencies/new",rowRenderer:function(e){return O(d.a.Row,{key:e._id},O(d.a.Cell,null,O(h.a,{href:"/currencies/edit?_id=".concat(e._id)},O("a",{href:"/currencies/edit?_id=".concat(e._id)},e.isoCode))),O(d.a.Cell,null,e.isActive&&O(f.a,{color:"green",name:"checkmark",size:"large"})))}}),O(d.a.Row,null,O(d.a.HeaderCell,null,"Code"),O(d.a.HeaderCell,null,"Active")))})),v=t("PZVx"),y=a.a.createElement;r.default=Object(v.a)((function(e){return y(i.a,e,y(o.a,null,y("h2",null,"Currencies"),y(w,null)))}))},YRLc:function(e,r,t){"use strict";t.d(r,"b",(function(){return g}));var n=t("KQm4"),a=t("rePB"),o=t("wx14"),i=t("Ff2n"),c=t("eHHv"),l=t("0dmp"),u=t("q1tI"),s=t.n(u),d=t("ikXu"),f=t("QetY"),p=t("D1pA"),h=t("NrgV"),b=t("RotF"),O=t.n(b),m=t("YFqc"),w=t.n(m),v=s.a.createElement;function y(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function j(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?y(Object(t),!0).forEach((function(r){Object(a.a)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}r.a=function(e){var r=e.items,t=e.cols,n=void 0===t?4:t,a=e.rowRenderer,c=e.createPath,l=(e.data,e.children),u=e.loadMoreEntries,s=(e.updateHasMore,e.hasMore),b=(e.loading,Object(i.a)(e,["items","cols","rowRenderer","createPath","data","children","loadMoreEntries","updateHasMore","hasMore","loading"]));return v(d.a,Object(o.a)({celled:!0},b),v(d.a.Header,null,v(d.a.Row,null,v(d.a.HeaderCell,{colSpan:n},c&&v(w.a,{href:c},v(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:c},v(p.a,{name:"plus"}),"Add")))),l),r&&v(O.a,{pageStart:0,element:"tbody",loadMore:u,hasMore:s,loader:v(d.a.Row,null,v(d.a.Cell,{colSpan:n},v(h.a,{active:!0,inline:"centered"})))},r.map(a)),v(d.a.Footer,{fullWidth:!0},v(d.a.Row,null,v(d.a.HeaderCell,{colSpan:n},c&&v(w.a,{href:c},v(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:c},v(p.a,{name:"plus"})," Add"))))))},Array.prototype.diff=function(e){return this.filter((function(r){return-1!==e.indexOf(r)}))};var g=function(e){var r=e.query,t=e.queryName,a=e.queryOptions,o=e.itemsPerPage,u=void 0===o?5:o;return Object(c.a)(Object(c.h)("hasMore","updateHasMore",!0),Object(l.a)(r,{options:function(e){e.hasMore,e.updateHasMore;var r=Object(i.a)(e,["hasMore","updateHasMore"]);return j({variables:j({offset:0,limit:u},r)},a)},props:function(e){var r=e.data,a=r.loading,o=r.fetchMore,c=Object(i.a)(r,["loading","fetchMore"]),l=e.ownProps,s=l.updateHasMore,d=l.hasMore;return{loading:a,hasMore:!(c[t]&&u>c[t].length)&&d,items:c[t],loadMoreEntries:function(){return o({variables:{offset:Math.floor(c[t].length/u)*u,limit:u},updateQuery:function(e,r){var a=r.fetchMoreResult;if(!a||0===a[t].length)return s(!1),e;var o=e[t].map((function(e){return e._id})),i=a[t].filter((function(e){return-1===o.indexOf(e._id)}));if(0===i.length)return s(!1),e;var c={};return c[t]=[].concat(Object(n.a)(e[t]),Object(n.a)(i)),j({},e,{},c)}})}}}}))}},dy9b:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/currencies",function(){return t("TsDr")}])}},[["dy9b",0,2,5,1,3,4,7]]]);