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