1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8143],{69623:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/faq",function(){return t(54723)}])},23915:function(e,n,t){"use strict";t.d(n,{kh:function(){return r},y:function(){return i}});var r="\n mutation CreateFaq(\n $input: CreateFaqInput!\n $condition: ModelFaqConditionInput\n ) {\n createFaq(input: $input, condition: $condition) {\n id\n topic\n question\n answer\n createdAt\n updatedAt\n isDeleted\n }\n }\n",i="\n mutation UpdateFaq(\n $input: UpdateFaqInput!\n $condition: ModelFaqConditionInput\n ) {\n updateFaq(input: $input, condition: $condition) {\n id\n topic\n question\n answer\n createdAt\n updatedAt\n isDeleted\n }\n }\n"},42138:function(e,n,t){"use strict";t.d(n,{QR:function(){return r},V3:function(){return a},r0:function(){return i},zO:function(){return o}});var r="\n query GetFaq($id: ID!) {\n getFaq(id: $id) {\n id\n topic\n question\n answer\n createdAt\n updatedAt\n isDeleted\n }\n }\n",i="\n query ListFaqs(\n $filter: ModelFaqFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listFaqs(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n topic\n question\n answer\n createdAt\n updatedAt\n isDeleted\n }\n nextToken\n }\n }\n",o="\n query FaqByCreatedAt(\n $isDeleted: Int\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelFaqFilterInput\n $limit: Int\n $nextToken: String\n ) {\n faqByCreatedAt(\n isDeleted: $isDeleted\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n topic\n question\n answer\n createdAt\n updatedAt\n isDeleted\n }\n nextToken\n }\n }\n",a="\n query SearchFaqs(\n $filter: SearchableFaqFilterInput\n $sort: SearchableFaqSortInput\n $limit: Int\n $nextToken: String\n ) {\n searchFaqs(\n filter: $filter\n sort: $sort\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n topic\n question\n answer\n createdAt\n updatedAt\n isDeleted\n }\n nextToken\n total\n }\n }\n"},13155:function(e){"use strict";e.exports={userRole:{admin:"owner",school:"school",teacher:"teacher"},isDeleted:{yes:1,no:0},bookType:{AUDIO:"AUDIO",EPUB:"EPUB",READALOUD:"READALOUD"},assignmentProgress:{notStarted:"NOT_STARTED",started:"STARTED",inProgress:"IN_PROGRESS",completed:"COMPLETED",pastDue:"PAST_DUE"},assignmentCompletedMinutes:15,subscriptionType:{paypal:"PAYPAL",authorizeNet:"AUTHORIZENET"},region:{region1:"Asia",region2:"Africa",region3:"North America",region4:"Caribbean",region5:"Europe",region6:"Other"},genre:{genre1:"Fiction",genre2:"Non-Fiction"},topic:{account:"How to Log-in to your iReadify account?",payments:"Subscription & payment",general:"General questions"},ireader:{url:"https://read.ireadify.com/ltigateway.htm",consumerKey:"bd2e37cdc25c42a0cc8397951afc8cf1",secretKey:"770a8908cbd043bdcb4a4e6aff6c75de",lisPersonContactEmailPrimary:"[email protected]"}}},54723:function(e,n,t){"use strict";t.r(n);var r=t(47568),i=t(26042),o=t(70655),a=t(85893),s=t(10552),l=t(44541),c=t(67294),d=t(43133),u=t(41664),p=t.n(u),h=t(30381),f=t.n(h),x=t(80958),m=t(23915),w=t(42138),b=t(13155),y=t(11163);n.default=function(){var e=(0,y.useRouter)().query.keyword,n=(0,c.useState)(),t=n[0],u=n[1],h=(0,c.useState)(!0),g=h[0],j=h[1],v=(0,c.useState)(""),q=v[0],A=v[1],N=(0,c.useState)(!1),$=N[0],D=N[1];(0,c.useEffect)((function(){e&&A(e),T(e)}),[e]);var T=function(){var e=(0,r.Z)((function(e){var n,t,r;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),j(!0),n={filter:{isDeleted:{eq:b.isDeleted.no}}},e&&(n={filter:{isDeleted:{eq:b.isDeleted.no},question:{matchPhrasePrefix:e}}},D(!0)),[4,s.b.graphql((0,l.wT)(w.V3,(0,i.Z)({sort:{direction:"asc",field:"topic"}},n)))];case 1:return t=o.sent(),u(t.data.searchFaqs.items),j(!1),[3,3];case 2:return r=o.sent(),console.log(r),[3,3];case 3:return[2]}}
1))}));return function(n){return e.apply(this,arguments)}}(),S=function(){var e=(0,r.Z)((function(){var e,n;return(0,o.__generator)(this,(function(t){return T(q),e="?keyword="+q,n=window.location.protocol+"//"+window.location.host+window.location.pathname+e,window.history.pushState({path:n},"",n),[2]}))}));return function(){return e.apply(this,arguments)}}(),k=function(){var e=(0,r.Z)((function(e,n){var r,i;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return 1!=confirm("Are you sure to delete '"+n+"' FAQ?")?[3,2]:(r={id:e,isDeleted:b.isDeleted.yes},[4,s.b.graphql((0,l.wT)(m.y,{input:r}))]);case 1:o.sent(),i=t.filter((function(n){return n.id!==e})),u(i),o.label=2;case 2:return[2]}}))}));return function(n,t){return e.apply(this,arguments)}}();return(0,a.jsx)(d.Z,{children:(0,a.jsx)("div",{className:"flex flex-1 flex-col md:flex-row lg:flex-row mx-2",children:(0,a.jsxs)("div",{className:"mb-2 border-solid border-gray-300 rounded border shadow-sm w-full",children:[(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"bg-white shadow p-4 flex",children:[(0,a.jsx)("span",{className:"w-auto flex justify-end items-center text-gray-500 p-2",children:(0,a.jsx)("i",{className:"fa fa-search"})}),(0,a.jsx)("input",{className:"w-full rounded p-2 font-sans search-box mr-1",name:"keyword",value:q,onChange:function(e){A(e.target.value.trim())},type:"text",placeholder:"Search by name..."}),""===q?(0,a.jsx)("button",{disabled:!0,className:"bg-indigo-400 whitespace-nowrap inline-flex font-medium text-white rounded p-2 pl-4 pr-4",children:"Search"}):(0,a.jsxs)("div",{className:"flex flex-1",children:[(0,a.jsx)("button",{onClick:S,className:"whitespace-nowrap inline-flex bg-gradient-to-r from-purple-bright to-purple-bright font-medium text-white hover:from-purple-light hover:to-blue-bright rounded p-2 pl-4 pr-4 mr-1",children:"Search"}),$?(0,a.jsx)("button",{onClick:function(){A(""),D(!1),T(null);var e=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.pushState({path:e},"",e)},className:"bg-red-500 text-white py-2 px-4 hover:bg-red-400 focus:outline-none flex items-center justify-center",children:"Cancel"}):null]})]})}),(0,a.jsx)("div",{className:"bg-purple-bright text-white text-bold px-2 py-3 border-solid border-gray-200 border-b",children:"List FAQ's"}),(0,a.jsxs)("div",{className:"p-3",children:[(0,a.jsx)(p(),{href:"/admin/faq/add",className:"flex align-baseline content-end justify-items-end m-1 p-1",children:(0,a.jsx)("button",{className:"bg-green-500 text-white py-2 px-4 mr-1 focus:outline-none flex items-center justify-center",children:" Add"})}),g?(0,a.jsx)(x.Z,{}):0===t.length?(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-center",children:"No Data"})}):(0,a.jsxs)("table",{className:"w-full rounded",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"border px-4 py-2",children:"Topic"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Questions"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Created At"}),(0,a.jsx)("th",{className:"border px-4 py-2",children:"Actions"})]})}),(0,a.jsx)("tbody",{children:t.map((function(e){return(0,a.jsxs)("tr",{className:"text-center",children:[(0,a.jsx)("td",{className:"border px-4 py-2",children:e.topic}),(0,a.jsx)("td",{className:"border px-4 py-2",children:e.question}),(0,a.jsxs)("td",{className:"border px-4 py-2",children:[f()(e.createdAt).format("L"),(0,a.jsx)("br",{}),f()(e.createdAt).format("LTS")]})," ",(0,a.jsx)("td",{className:"border px-4 py-2 ",children:(0,a.jsxs)("div",{className:"flex flex-1 justify-center",children:[(0,a.jsx)("span",{title:"Edit",className:"text-red-500 block w-4 cursor-pointer mx-2 ",children:(0,a.jsx)(p(),{href:"/admin/faq/edit/".concat(e.id),legacyBehavior:!0,children:(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:[(0,a.jsx)("path",{d:"M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z"}),(0,a.jsx)("path",{fillRule:"evenodd",d:"M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z",clipRule:"evenodd"})]})})}),(0,a.jsx)("span",{title:"Delete",className:"text-red-500 block w-4 cursor-pointer mx-2",onClick:function(){return k(e.id,e.question)},children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})})]})})]},e.id)}))})]})]})]})})})}},99534:function(e,n,t){"use strict";function r(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}
1(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}t.d(n,{Z:function(){return r}})}},function(e){e.O(0,[1664,3654,3133,9774,2888,179],(function(){return n=69623,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.