_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[53],{QSOU:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/quotations",function(){return n("ytoK")}])},YRLc:function(e,t,n){"use strict";n.d(t,"b",(function(){return y}));var r=n("KQm4"),a=n("rePB"),l=n("wx14"),o=n("Ff2n"),i=n("eHHv"),u=n("0dmp"),c=n("q1tI"),s=n.n(c),d=n("ikXu"),f=n("QetY"),p=n("D1pA"),b=n("RotF"),m=n.n(b),O=n("YFqc"),_=n.n(O),h=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 w(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,i=e.createPath,u=(e.data,e.children),c=e.loadMoreEntries,s=(e.loading,e.limit),b=Object(o.a)(e,["items","cols","rowRenderer","createPath","data","children","loadMoreEntries","loading","limit"]);return h(d.a,Object(l.a)({celled:!0},b),h(d.a.Header,null,h(d.a.Row,null,h(d.a.HeaderCell,{colSpan:r},i&&h(_.a,{href:i},h(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},h(p.a,{name:"plus"}),"Add")))),u),t&&h(m.a,{pageStart:0,element:"tbody",loadMore:c,hasMore:null===s||void 0===s||s},t.map(a)),h(d.a.Footer,{fullWidth:!0},h(d.a.Row,null,h(d.a.HeaderCell,{colSpan:r},i&&h(_.a,{href:i},h(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},h(p.a,{name:"plus"})," Add"))))))};var y=function(e){var t=e.query,n=e.queryName,l=e.itemsPerPage,c=void 0===l?5:l;return Object(i.a)(Object(u.a)(t,{options:function(e){var t=e.queryOptions,n=Object(o.a)(e,["queryOptions"]);return w({variables:w({offset:0,limit:c},n)},t)},props:function(e){var t=e.data,l=t.loading,i=t.fetchMore,u=t.stopPolling,c=Object(o.a)(t,["loading","fetchMore","stopPolling"]);return{loading:l,items:c[n],loadMoreEntries:function(){return u(),i({variables:{offset:c[n].length},updateQuery:function(e,t){var l=t.fetchMoreResult;return l?w(w({},e),{},Object(a.a)({},n,[].concat(Object(r.a)(e[n]),Object(r.a)(l[n])))):e}})}}}}))}},ytoK:function(e,t,n){"use strict";n.r(t);var r=n("wx14"),a=n("q1tI"),l=n.n(a),o=n("yE/o"),i=n("gaPq"),u=n("h4VS"),c=n("Ff2n"),s=n("sWYD"),d=n("lTCR"),f=n.n(d),p=n("ikXu"),b=n("YFqc"),m=n.n(b),O=n("YRLc"),_=l.a.createElement;function h(){var e=Object(u.a)(["\n    query quotations($offset: Int, $limit: Int) {\n      quotations(offset: $offset, limit: $limit) {\n        _id\n        expires\n        quotationNumber\n        status\n        user {\n          _id\n          name\n        }\n        product {\n          _id\n          ... on SimpleProduct {\n            sku\n          }\n          texts {\n            _id\n            title\n          }\n        }\n      }\n    }\n  "]);return h=function(){return e},e}var j=Object(O.b)({queryName:"quotations",query:f()(h())})((function(e){e.loading,e.updateHasMore;var t=Object(c.a)(e,["loading","updateHasMore"]);return _(O.a,Object(r.a)({},t,{cols:5,createPath:null,rowRenderer:function(e){return _(p.a.Row,{key:e._id},_(p.a.Cell,null,_(m.a,{href:"/quotations/view?_id=".concat(e._id)},_("a",{href:"/quotations/view?_id=".concat(e._id)},e.quotationNumber?_(l.a.Fragment,null,_("b",null,e.quotationNumber),_("small",null,"\xa0(",e._id,")")):_(l.a.Fragment,null,_("b",null,"RFP"),_("small",null,"\xa0(",e._id,")"))))),_(p.a.Cell,null,e.product&&_(m.a,{href:"/products/edit?_id=".concat(e.product._id)},_("a",{href:"/products/edit?_id=".concat(e.product._id)},_("b",null,e.product.texts.title),_("small",null,"\xa0(",e.product.sku,")")))),_(p.a.Cell,null,e.user&&_(m.a,{href:"/users/edit?_id=".concat(e.user._id)},_("a",{href:"/users/edit?_id=".concat(e.user._id)},e.user.name||e.user._id))),_(p.a.Cell,null,e.expires?Object(s.default)(e.expires,"Ppp"):"n/a"),_(p.a.Cell,null,e.status))}}),_(p.a.Row,null,_(p.a.HeaderCell,null,"Quotation #"),_(p.a.HeaderCell,null,"Product"),_(p.a.HeaderCell,null,"User"),_(p.a.HeaderCell,null,"Expiry Date"),_(p.a.HeaderCell,null,"Status")))})),w=n("PZVx"),y=l.a.createElement;t.default=Object(w.a)((function(e){var t=Object(r.a)({},e);return y(i.a,t,y(o.a,null,y("h2",null,"Quotations"),y(j,null)))}))}},[["QSOU",0,2,5,1,3,4,7,8]]]);