1import{r as n,y as F,p as e,L as u,T as x,v as R,ag as C,a0 as d,w as f,a_ as D}from"./index-C9IH3k-2.js";import{I as T,g as b}from"./TemplateUtil-D1DzmWLm.js";import{P as j}from"./PhoneFeature-D7MHCLCP.js";import{D as z}from"./index-CmSVNJzc.js";import{R as N}from"./CommentOutlined-CxUED1EU.js";import{P as I}from"./Pagination-D1z-xPUv.js";import"./Wrapper-ChjuDa3w.js";import"./HelperMethods-C-ewwU_x.js";import"./MainApp-BoiAvjMg.js";import"./index-1obnpDkF.js";import"./index-DNqpjC0Z.js";import"./index-Bv3SRNsl.js";import"./CalendarOutlined-DyzsKNdO.js";import"./ClockCircleOutlined-Cym7vptW.js";const{Text:o}=x,{Search:E}=C,K=()=>{const[p,y]=n.useState([]),[S,h]=n.useState(!1),[a,c]=n.useState({current:1,pageSize:10,total:0}),[r,P]=n.useState({dateRange:[]});n.useEffect(()=>{m(a.current,a.pageSize)},[r,a.current,a.pageSize]);const m=async(t,l,g)=>{h(!0);try{const s={pagination:{current:t,pageSize:l},order:[{fieldName:"creationTime",dir:"desc"}],search:[]};g&&s.search.push({fieldName:"customer",value:[g]}),r.dateRange.length>0&&s.search.push({fieldName:"creationTime",value:[r.dateRange[0]?.valueOf(),r.dateRange[1]?.valueOf()]});const i=await F("/api/v1/admin/phoneFeature/phoneFeatureAudits",s);i&&i.status===200&&(y(i.data.results),c({...a,total:i.data.total}))}catch(s){console.error("Failed to fetch data:",s)}finally{h(!1)}},w=t=>{P({...r,dateRange:t}),c({...a,current:1})},v=(t,l)=>{c({...a,current:t,pageSize:l})};return e.jsxs(u,{vertical:!0,gap:"large",children:[e.jsx(u,{justify:"space-between",children:e.jsx(x.Title,{level:4,style:{margin:0},children:"Customer List"})}),e.jsx(u,{justify:"end",children:e.jsxs(R,{children:[e.jsx(E,{placeholder:"Search by User name",allowClear:!0,onSearch:t=>m(1,a.pageSize,t)}),e.jsx(z.RangePicker,{onChange:w,format:"YYYY-MM-DD",style:{width:250}})]})}),e.jsx("div",{children:p.length?p.map(t=>e.jsx("div",{children:e.jsxs(T,{loading:S,children:[e.jsxs(d,{justify:"space-between",children:[e.jsx(f,{title:"User Name",children:e.jsx(o,{children:t?.customer?.username})}),e.jsxs(o,{children:["Phone Number ID: ",t.phoneNumberId]}),e.jsx(o,{children:b(t.creationTime)})]}),e.jsx(d,{justify:"space-between",children:e.jsx(f,{title:"Comments",children:e.jsxs(o,{strong:!0,children:[e.jsx(N,{})," ",t.comment]})})}),e.jsxs(d,{justify:"space-between",children:[e.jsx(j,{feature:t?.oldPhoneFeature,title:"Old Phone Features",registred:t?.active}),e.jsx(j,{feature:t?.newPhoneFeature,title:"New Phone Features",registred:t?.active})]})]})},t.id)):e.jsx(D,{})}),e.jsx(I,{current:a.current,pageSize:a.pageSize,total:a.total,onChange:v,showSizeChanger:!0,showQuickJumper:!0,style:{marginTop:20},align:"end"})]})};export{K 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.