(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{Kpik:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/products",function(){return r("q2dU")}])},q2dU:function(e,t,r){"use strict";r.r(t);var n=r("q1tI"),a=r.n(n),o=r("yE/o"),l=r("gaPq"),c=r("KQm4"),u=r("rePB"),i=r("h4VS"),s=r("eHHv"),d=r("lTCR"),p=r.n(d),f=r("0dmp"),b=r("ikXu"),h=r("QetY"),g=r("D1pA"),w=r("NrgV"),O=r("MqQV"),m=r("RotF"),y=r.n(m),j=r("YFqc"),P=r.n(j),v=a.a.createElement;function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){Object(u.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function C(){var e=Object(i.a)(["\n  query getAllProducts($offset: Int, $limit: Int) {\n    products(offset: $offset, limit: $limit, includeDrafts: true) {\n      _id\n      tags\n      status\n      texts {\n        _id\n        slug\n        title\n      }\n    }\n  }\n"]);return C=function(){return e},e}var M=p()(C()),E=Object(s.a)(Object(s.h)("hasMore","updateHasMore",!0),Object(f.a)(M,{options:function(){return{variables:{offset:0,limit:10}}},props:function(e){var t=e.data,r=t.loading,n=t.products,a=t.fetchMore,o=e.ownProps.updateHasMore;return{loading:r,products:n,loadMoreEntries:function(){return a({variables:{offset:n.length,limit:10},updateQuery:function(e,t){var r=t.fetchMoreResult;if(!r||0===r.products.length)return o(!1),e;var n=r.products[0]._id;return e.products.reduce((function(e,t){return t._id===n||e}),!1)?(o(!1),e):k(k({},e),{},{products:[].concat(Object(c.a)(e.products),Object(c.a)(r.products))})}})}}}}),s.e)((function(e){var t=e.products,r=e.loadMoreEntries,n=e.hasMore;return v(b.a,{celled:!0},v(b.a.Header,null,v(b.a.Row,null,v(b.a.HeaderCell,{colSpan:"3"},v(P.a,{href:"/products/new"},v(h.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:"/products/new"},v(g.a,{name:"plus"}),"Add")))),v(b.a.Row,null,v(b.a.HeaderCell,null,"Name"),v(b.a.HeaderCell,null,"Active"),v(b.a.HeaderCell,null,"Tags"))),t&&v(y.a,{element:"tbody",loadMore:r,hasMore:n,loader:v(b.a.Row,{key:"product-loader"},v(b.a.Cell,{colSpan:"4"},v(w.a,{active:!0,inline:"centered"})))},t.map((function(e){return v(b.a.Row,{key:e._id},v(b.a.Cell,null,v(P.a,{href:"/products/edit?_id=".concat(e._id)},v("a",{href:"/products/edit?_id=".concat(e._id)},e.texts.title))),v(b.a.Cell,null,"ACTIVE"===e.status&&v(g.a,{color:"green",name:"checkmark",size:"large"})),v(b.a.Cell,null,e.tags&&e.tags.length>0&&e.tags.map((function(e){return v(O.a,{key:e,color:"grey",horizontal:!0},e)}))))}))),v(b.a.Footer,{fullWidth:!0},v(b.a.Row,null,v(b.a.HeaderCell,{colSpan:"3"},v(P.a,{href:"/products/new"},v(h.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:"/products/new"},v(g.a,{name:"plus"}),"Add"))))))})),H=r("PZVx"),R=a.a.createElement;t.default=Object(H.a)((function(e){return R(l.a,e,R(o.a,null,R("h2",null,"Products"),R(E,null)))}))}},[["Kpik",0,2,5,1,3,4,7]]]);