PageSourceSearch

https://cms.businesswireindia.com/assets/DetailsTable-9a5b4a49.js

js businesswireindia.com collected 2026-10-02 03:38:53 UTC 2,472 bytes, 1 lines download raw bytes

1import{a as A,r,e as J,I as R,by as B,J as F,w as e,L as q,ai as z,al as G,ak as K,B as U}from"./index-8acdbf7a.js";const O=({handleEditType:f})=>{const b=A(),[u,l]=r.useState([]),{journalistType:N}=J(t=>t.basicMaster),[x,{isLoading:p,data:a}]=R(),[S,{isLoading:v,data:C,error:o}]=B(),[M,g]=r.useState(!1),[w,I]=r.useState(""),[n,c]=r.useState(1),i=10,m=n*i,j=m-i,h=u.slice(j,m)??[],y=Math.ceil(u.length/i);r.useEffect(()=>{x({type:"Category",limit:100,skip:0})},[]),r.useEffect(()=>{a&&(b(F(a)),l(a))},[p,a]),r.useEffect(()=>{o&&(x({type:"Category",limit:100,skip:0}),g(!0),I((o==null?void 0:o.data)??""))},[v,C,o]);const L=()=>{n>1&&c(n-1)},P=()=>{n<y&&c(n+1)},T=t=>{c(t)},k=t=>{const s=t.target.value.toLowerCase(),d=a==null?void 0:a.filter(E=>E.categoryName.toLowerCase().includes(s));c(1),s==""?l(a):d.length>0?l(d):l([])},D=t=>{confirm("Are you sure you want to deactivate this?")===!0&&S(t.categoryId)};return e.jsx("div",{className:"col-xl-8",children:e.jsxs("div",{className:"card card-body border-primary",children:[e.jsx("div",{className:" mb-3",children:e.jsx("input",{type:"search",className:"form-control ",placeholder:"Search",onKeyUp:k})}),e.jsx("div",{className:"table-responsive",children:e.jsxs("table",{className:"table table-striped table-bordered table-hover table-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"S.No."}),e.jsx("th",{children:"Type"}),e.jsx("th",{children:"Action"})]})}),e.jsxs("tbody",{children:[p&&e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"text-center",children:e.jsx(q,{})})}),h.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,style:{textAlign:"center"},children:"No Records Found!"})}):h.filter((t,s)=>s===h.findIndex(d=>t.categoryId===d.categoryId)).filter(t=>t.categoryName!==null).sort((t,s)=>t.categoryName.localeCompare(s.categoryName)).map((t,s)=>e.jsxs("tr",{children:[e.jsx("td",{children:j+s+1}),e.jsx("td",{children:t.categoryName}),e.jsx("td",{children:e.jsxs("div",{className:"hstack",children:[e.jsx("button",{type:"button",title:"Edit",className:"btn text-primary btn-sm",onClick:()=>{f(t)},children:e.jsx(z,{})}),e.jsx("button",{type:"button",title:"Deactivate",className:"btn text-danger btn-sm",onClick:()=>D(t),children:e.jsx(G,{})})]})})]},s.toString()))]})]})}),e.jsx(K,{currentState:n,handlePrev:L,handleNext:P,totalPost:y,handlePages:T,pageSize:i,siblingCount:1,totalRecord:N.length}),M&&e.jsx(U,{setShowModal:g,modalMsg:w})]})})};export{O as default};

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.