_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[55],{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 w}));var r=n("KQm4"),a=n("rePB"),l=n("wx14"),o=n("Ff2n"),i=n("eHHv"),u=n("DI+Y"),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"),h=n.n(O),_=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}var w=function(e){var t=e.query,n=e.queryName,l=e.itemsPerPage,c=void 0===l?5:l;return Object(i.a)(Object(u.graphql)(t,{options:function(e){var t=e.queryOptions,n=Object(o.a)(e,["queryOptions"]);return v({variables:v({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?v(v({},e),{},Object(a.a)({},n,[].concat(Object(r.a)(e[n]),Object(r.a)(l[n])))):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.searchComponent,c=(e.data,e.children),s=e.loadMoreEntries,b=(e.loading,e.limit),O=Object(o.a)(e,["items","cols","rowRenderer","createPath","searchComponent","data","children","loadMoreEntries","loading","limit"]);return _(d.a,Object(l.a)({celled:!0},O),_(d.a.Header,null,_(d.a.Row,null,_(d.a.HeaderCell,{colSpan:r},u&&u,i&&_(h.a,{href:i},_(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},_(p.a,{name:"plus"}),"Add")))),c),t&&_(m.a,{pageStart:0,element:"tbody",loadMore:s,hasMore:null===b||void 0===b||b},t.map(a)),_(d.a.Footer,{fullWidth:!0},_(d.a.Row,null,_(d.a.HeaderCell,{colSpan:r},i&&_(h.a,{href:i},_(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},_(p.a,{name:"plus"})," Add"))))))}},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"),h=l.a.createElement;function _(){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 _=function(){return e},e}var j=Object(O.b)({queryName:"quotations",query:f()(_())})((function(e){e.loading,e.updateHasMore;var t=Object(c.a)(e,["loading","updateHasMore"]);return h(O.a,Object(r.a)({},t,{cols:5,createPath:null,rowRenderer:function(e){var t;return h(p.a.Row,{key:e._id},h(p.a.Cell,null,h(m.a,{href:"/quotations/view?_id=".concat(e._id)},h("a",{href:"/quotations/view?_id=".concat(e._id)},e.quotationNumber?h(l.a.Fragment,null,h("b",null,e.quotationNumber),h("small",null,"\xa0(",e._id,")")):h(l.a.Fragment,null,h("b",null,"RFP"),h("small",null,"\xa0(",e._id,")"))))),h(p.a.Cell,null,e.product&&h(m.a,{href:"/products/edit?_id=".concat(e.product._id)},h("a",{href:"/products/edit?_id=".concat(e.product._id)},h("b",null,null===(t=e.product.texts)||void 0===t?void 0:t.title),h("small",null,"\xa0(",e.product.sku,")")))),h(p.a.Cell,null,e.user&&h(m.a,{href:"/users/edit?_id=".concat(e.user._id)},h("a",{href:"/users/edit?_id=".concat(e.user._id)},e.user.name||e.user._id))),h(p.a.Cell,null,e.expires?Object(s.default)(e.expires,"Ppp"):"n/a"),h(p.a.Cell,null,e.status))}}),h(p.a.Row,null,h(p.a.HeaderCell,null,"Quotation #"),h(p.a.HeaderCell,null,"Product"),h(p.a.HeaderCell,null,"User"),h(p.a.HeaderCell,null,"Expiry Date"),h(p.a.HeaderCell,null,"Status")))})),v=n("PZVx"),w=l.a.createElement;t.default=Object(v.a)((function(e){var t=Object(r.a)({},e);return w(i.a,t,w(o.a,null,w("h2",null,"Quotations"),w(j,null)))}))}},[["QSOU",0,2,3,1,4,5,8,9]]]);