(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7255],{2594:(e,a,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/category/CategoryList",function(){return r(77621)}])},77621:(e,a,r)=>{"use strict";r.r(a),r.d(a,{default:()=>j});var s=r(37876),t=r(14232),l=r(31777),n=r(16190),c=r(64329),i=r(3945),d=r(84780),o=r(80791),h=r(95108),u=r(91403);let m=(0,h.zD)("get/categoryList",async(e,a)=>{let{rejectWithValue:r}=a;try{return(await u.Ay.get("/categoryList",{params:e})).data}catch(e){var s,t,l,n,c;return r({error:null==e||null==(t=e.response)||null==(s=t.data)?void 0:s.error,message:(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.message)||(null==e||null==(c=e.error)?void 0:c.message)})}});var g=r(48230),x=r.n(g);let j=()=>{let{checkPermission:e}=(0,o.Z)(),[a,r]=(0,t.useState)([]),[h,u]=(0,t.useState)({specialty:null,status:null,searchTerm:""}),g=(0,l.wA)(),j=async e=>{r((await g(m(e))).payload)};(0,t.useEffect)(()=>{j(h)},[]);let p=(e,a)=>{let r={...h,[a]:(null==e?void 0:e.value)?e.value:null};u(r="searchTerm"===a?{searchTerm:e}:{...r,searchTerm:""}),j(r)},y=[{key:"id",name:"ID",cell:e=>"".concat(String(e.id))},{key:"categoryName",name:"Category Name",cell:e=>e.categoryName?(0,s.jsx)("span",{children:e.categoryName}):"-"},{key:"action",name:"Action",cell:a=>(0,s.jsx)(s.Fragment,{children:e("blog",n.dn.edit,(0,s.jsx)(x(),{href:"/adminpanel/blog/master-module/category/edit/".concat(a.id),className:"action-icon","aria-label":"edit",children:(0,s.jsx)(c.qU,{height:15,width:15})}))})}];return(0,s.jsxs)("div",{className:"container-listing listing hr-listing ",children:[(0,s.jsxs)("div",{className:"resource-header horizontal-p-20",children:[(0,s.jsx)("div",{className:"search-sec",children:(0,s.jsx)(i.Lw,{bg_color:"#fff",value:h.searchTerm,placeholder:"Search",onChange:e=>p(e.target.value,"searchTerm")})}),(0,s.jsx)("div",{className:"filter-section",children:(0,s.jsx)("div",{className:"action-btn",children:e("doctors",n.dn.add,(0,s.jsx)(x(),{href:"/adminpanel/blog/master-module/category/add",children:(0,s.jsx)(i.jn,{textTransform:"capitalize",background:"#fff",height:"35px",children:"Add +"})}))})})]}),(0,s.jsx)("div",{className:"resource-body hr-listing-body",children:a&&a.length>0?(0,s.jsx)(i.up,{columns:y,data:a,pagination:!0,progressComponent:(0,s.jsx)(d.A,{columns:y})}):(0,s.jsx)(i.up,{columns:y})})]})}},84780:(e,a,r)=>{"use strict";r.d(a,{A:()=>l});var s=r(37876);r(14232);var t=r(96010);r(71463);let l=e=>{let{columns:a,rowCount:r=8}=e;return(0,s.jsxs)("table",{className:"table mt-2",children:[(0,s.jsx)("thead",{}),(0,s.jsx)("tbody",{children:[...Array(r)].map(()=>(0,s.jsx)("tr",{children:a.map((e,a)=>(0,s.jsx)("td",{children:(0,s.jsx)(t.A,{height:20,width:"100%"})},a))},Math.random().toString(36).substring(7)))})]})}}},e=>{var a=a=>e(e.s=a);e.O(0,[636,6593,8792],()=>a(2594)),_N_E=e.O()}]);
//# sourceMappingURL=CategoryList-9b18cd1047a09bf5.js.map