_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[26],{Gy1X:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n.n(r),o=n("yE/o"),i=n("gaPq"),c=n("h4VS"),l=n("wx14"),u=n("Ff2n"),s=n("eHHv"),d=n("lTCR"),f=n.n(d),b=n("0dmp"),p=n("ikXu"),O=n("D1pA"),m=n("QetY"),h=n("YFqc"),y=n.n(h),j=n("YRLc"),v=a.a.createElement;function g(){var e=Object(c.a)(["\n      mutation changeBaseCountry($countryId: ID!) {\n        setBaseCountry(countryId: $countryId) {\n          _id\n          isBase\n        }\n      }\n    "]);return g=function(){return e},e}function w(){var e=Object(c.a)(["\n      query countries($limit: Int, $offset: Int) {\n        countries(limit: $limit, offset: $offset, includeInactive: true) {\n          _id\n          isoCode\n          isActive\n          isBase\n          name\n        }\n      }\n    "]);return w=function(){return e},e}var P=Object(s.a)(Object(j.b)({queryName:"countries",query:f()(w())}),Object(b.a)(f()(g()),{options:{refetchQueries:["countries"]}}),Object(s.f)({changeBaseCountry:function(e){var t=e.mutate;return function(e,n){return t({variables:{countryId:n.name}})}}}),s.e)((function(e){var t=e.changeBaseCountry,n=Object(u.a)(e,["changeBaseCountry"]);return v(j.a,Object(l.a)({},n,{cols:3,createPath:"/countries/new",rowRenderer:function(e){return v(p.a.Row,{key:e._id},v(p.a.Cell,null,v(y.a,{href:"/countries/edit?_id=".concat(e._id)},v("a",{href:"/countries/edit?_id=".concat(e._id)},e.isoCode))),v(p.a.Cell,null,e.isActive&&v(O.a,{color:"green",name:"checkmark",size:"large"})),v(p.a.Cell,null,e.isBase?v("b",null,"Basisland"):v(m.a,{basic:!0,name:e._id,onClick:t},"Als Basisland festlegen")))}}),v(p.a.Row,null,v(p.a.HeaderCell,null,"Name"),v(p.a.HeaderCell,null,"Active?"),v(p.a.HeaderCell,null,"Basisland")))})),_=n("PZVx"),C=a.a.createElement;t.default=Object(_.a)((function(e){return C(i.a,e,C(o.a,null,C("h2",null,"Countries"),C(P,null)))}))},YRLc:function(e,t,n){"use strict";n.d(t,"b",(function(){return g}));var r=n("KQm4"),a=n("rePB"),o=n("wx14"),i=n("Ff2n"),c=n("eHHv"),l=n("0dmp"),u=n("q1tI"),s=n.n(u),d=n("ikXu"),f=n("QetY"),b=n("D1pA"),p=n("RotF"),O=n.n(p),m=n("YFqc"),h=n.n(m),y=s.a.createElement;function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.items,n=e.cols,r=void 0===n?4:n,a=e.rowRenderer,c=e.createPath,l=(e.data,e.children),u=e.loadMoreEntries,s=(e.loading,e.limit),p=Object(i.a)(e,["items","cols","rowRenderer","createPath","data","children","loadMoreEntries","loading","limit"]);return y(d.a,Object(o.a)({celled:!0},p),y(d.a.Header,null,y(d.a.Row,null,y(d.a.HeaderCell,{colSpan:r},c&&y(h.a,{href:c},y(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:c},y(b.a,{name:"plus"}),"Add")))),l),t&&y(O.a,{pageStart:0,element:"tbody",loadMore:u,hasMore:null===s||void 0===s||s},t.map(a)),y(d.a.Footer,{fullWidth:!0},y(d.a.Row,null,y(d.a.HeaderCell,{colSpan:r},c&&y(h.a,{href:c},y(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:c},y(b.a,{name:"plus"})," Add"))))))};var g=function(e){var t=e.query,n=e.queryName,o=e.itemsPerPage,u=void 0===o?5:o;return Object(c.a)(Object(l.a)(t,{options:function(e){var t=e.queryOptions,n=Object(i.a)(e,["queryOptions"]);return v({variables:v({offset:0,limit:u},n)},t)},props:function(e){var t=e.data,o=t.loading,c=t.fetchMore,l=t.stopPolling,u=Object(i.a)(t,["loading","fetchMore","stopPolling"]);return{loading:o,items:u[n],loadMoreEntries:function(){return l(),c({variables:{offset:u[n].length},updateQuery:function(e,t){var o=t.fetchMoreResult;return o?v(v({},e),{},Object(a.a)({},n,[].concat(Object(r.a)(e[n]),Object(r.a)(o[n])))):e}})}}}}))}},cVFh:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/countries",function(){return n("Gy1X")}])}},[["cVFh",0,2,5,1,3,4,7]]]);