"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[390],{2390:(e,s,t)=>{t.r(s),t.d(s,{default:()=>S});var n=t(5043),r=t(6446),i=t(3336),l=t(1663),o=t(1806),a=t(4882),c=t(8076),d=t(2420),x=t(3460),h=t(9135),u=t(35),j=t(1838),g=t(7392),p=t(5316),A=t(1906),y=t(6801),f=t(4802),m=(t(64),t(4297),t(4556)),v=t(7710),b=t(579);const S=()=>{const e=(0,y.Gq)("enuseloc"),s=e&&Object.keys(e).length>0?e.id:null,t=(0,m.d4)((e=>{var s,t;return null===e||void 0===e||null===(s=e.marketing)||void 0===s||null===(t=s.getEnquiry)||void 0===t?void 0:t.data})),S=(0,m.wA)();console.log("getEnquiry",t);const[C,k]=(0,n.useState)([]);console.log("rows",C);const[w,E]=(0,n.useState)(!1),[q,z]=(0,n.useState)("create"),[D,N]=(0,n.useState)({category:"",question:"",answer:""}),[W,_]=(0,n.useState)(1),[R,I]=(0,n.useState)(10),O=C.slice((W-1)*R,W*R),[L,T]=(0,n.useState)(null);(0,n.useEffect)((()=>{S((0,v.$S)({categoryID:"",isActive:"",iDisplayLength:-1,iDisplayStart:0,sortOrder:"",generalSearch:""}))}),[w]),(0,n.useEffect)((()=>{t&&Array.isArray(t)&&k(t)}),[t,w]);return(0,b.jsxs)(r.A,{sx:{background:"#e9efff",minHeight:"100vh",padding:"30px"},children:[(0,b.jsx)(r.A,{sx:{mb:2,textAlign:"left"},children:(0,b.jsx)("h2",{style:{margin:0},children:"Enquiry \u554f\u3044\u5408\u308f\u305b"})}),(0,b.jsxs)(i.A,{elevation:1,sx:{borderRadius:"12px",padding:"20px"},children:[(0,b.jsxs)(r.A,{sx:{display:"flex",justifyContent:"space-between",mb:2,alignItems:"center"},children:[(0,b.jsx)("h3",{style:{margin:0},children:"Enquiry-\u554f\u3044\u5408\u308f\u305b/ Enquiry List"}),"\xa0",(0,b.jsx)("div",{children:"\xa0"})]}),(0,b.jsx)(l.A,{fullWidth:!0,placeholder:"\u691c\u7d22... / Search...",size:"small",sx:{mb:2,backgroundColor:"#f5f5f5",borderRadius:"6px"}}),(0,b.jsxs)(o.A,{children:[(0,b.jsx)(a.A,{children:(0,b.jsxs)(c.A,{children:[(0,b.jsx)(d.A,{children:"Sl.No"}),(0,b.jsx)(d.A,{children:"Name"}),(0,b.jsx)(d.A,{children:"Contact Number"}),(0,b.jsx)(d.A,{children:"Description"}),(0,b.jsx)(d.A,{children:"Created On"})]})}),(0,b.jsx)(x.A,{children:O.map(((e,s)=>(0,b.jsxs)(c.A,{children:[(0,b.jsx)(d.A,{children:(W-1)*R+s+1}),(0,b.jsx)(d.A,{children:(0,b.jsx)("div",{style:{color:"#888",fontSize:14},children:e.user_name})}),(0,b.jsxs)(d.A,{children:[(0,b.jsx)("div",{children:e.jpAnswer}),(0,b.jsx)("div",{style:{color:"#888",fontSize:12},children:e.contact_number})]}),(0,b.jsxs)(d.A,{children:[(0,b.jsx)("div",{children:e.jpAnswer}),(0,b.jsx)("div",{style:{color:"#888",fontSize:12},children:e.description})]}),(0,b.jsxs)(d.A,{children:[(0,b.jsx)("div",{children:e.jpAnswer}),(0,b.jsx)("div",{style:{color:"#888",fontSize:12},children:e.added_on})]})]},s)))}),(0,b.jsx)(r.A,{display:"flex",justifyContent:"center",mt:2,children:(0,b.jsx)(h.A,{count:Math.ceil(C.length/R),page:W,onChange:(e,s)=>_(s),color:"primary",shape:"rounded"})})]})]}),(0,b.jsxs)(u.A,{open:w,onClose:()=>E(!1),fullWidth:!0,maxWidth:"sm",children:[(0,b.jsxs)(j.A,{sx:{fontWeight:"bold",m:0,p:2},children:[" ","create"===q?"New Category Registration":"/ Edit Category",(0,b.jsx)(g.A,{"aria-label":"close",onClick:()=>E(!1),sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},children:(0,b.jsx)(f.A,{})})]}),(0,b.jsxs)(p.A,{sx:{pb:3},children:[(0,b.jsx)("p",{style:{color:"#666"},children:"create"===q?"":"Update Category information"}),(0,b.jsx)(l.A,{label:"\u30ab\u30c6\u30b4\u30ea\u30fc / Category",name:"category",value:D.category,onChange:e=>{N({...D,[e.target.name]:e.target.value})},fullWidth:!0,sx:{mt:2}}),(0,b.jsx)(A.A,{fullWidth:!0,variant:"contained",sx:{mt:3,background:"#0c1b50",padding:"10px",fontSize:"16px",textTransform:"none"},onClick:()=>(async()=>{if("create"===q){const e={userID:s,categoryName:(null===D||void 0===D?void 0:D.category)||""};await S((0,v.a)(e))}else{const e={categoryID:(null===L||void 0===L?void 0:L.id)||"",categoryName:(null===D||void 0===D?void 0:D.category)||"",isActive:1};console.log("editRow",L),await S((0,v.T_)(e))}E(!1)})(),children:"create"===q?"\u767b\u9332 / Register":"\u66f4\u65b0 / Update"})]})]})]})}}}]);
//# sourceMappingURL=390.9a97ef10.chunk.js.map