PageSourceSearch

https://industrialiq.ai/AdminFeedbackPage-Bq_ZmmSj.js

js industrialiq.ai collected 2026-10-04 23:46:15 UTC 4,236 bytes, 1 lines download raw bytes

1import{j as e,r as t}from"./index-GDMS6ldZ.js";import{f as s}from"./adminPlatformApi-CEamUoVG.js";import{A as r}from"./AdminListPageHeader-3o4Km4dD.js";import{A as a}from"./AdminDataTable-CcoZ3Y6N.js";import{M as i}from"./Modal-C-4Ot5sZ.js";import"./InformationCircleIcon-BqW0tfkd.js";import"./ArrowPathIcon-D-MTjHNq.js";import"./AdminAsyncState-VhllU-mN.js";import"./ExclamationCircleIcon-DBE7OqCV.js";import"./ChevronLeftIcon-BUBYIo34.js";import"./ChevronRightIcon-8w11xhHf.js";import"./dialog-DI7BzUC6.js";import"./portal-CpA9E1LO.js";import"./use-tab-direction-r0j1w13K.js";import"./hidden-DAIQtKKH.js";import"./XMarkIcon-saypijZy.js";function l({open:t,setOpen:s,feedback:r}){const a=()=>s(!1);return e.jsx(i,{isOpen:t,onClose:a,title:`Feedback from ${(null==r?void 0:r.userName)||"User"}`,size:"xl",footer:e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{type:"button",onClick:a,className:"inline-flex justify-center rounded-md bg-gray-100 px-4 py-2 text-sm font-semibold text-gray-900 hover:bg-gray-200",children:"Close"})}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-400",children:"Email"}),e.jsx("p",{className:"text-sm text-gray-200 break-all",children:null==r?void 0:r.userEmail})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-400",children:"Date"}),e.jsx("p",{className:"text-sm text-gray-200",children:null==r?void 0:r.createdAt})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-400",children:"Message"}),e.jsx("div",{className:"mt-1 rounded-md border border-gray-600 bg-gray-800 px-3 py-3 text-sm text-gray-200 whitespace-pre-wrap",children:null==r?void 0:r.message})]})]})})}function n(e,t=15){if(!e)return"";const s=e.trim().split(/\s+/);return s.length<=t?e:s.slice(0,t).join(" ")+"…"}const o=[{id:"user",header:"User",meta:{width:"160px"},cell:({row:t})=>e.jsx("span",{className:"text-neutral-900",children:t.original.userName})},{id:"email",header:"Email",meta:{width:"220px"},cell:({row:t})=>e.jsx("span",{className:"text-neutral-700",children:t.original.userEmail})},{id:"message",header:"Message",cell:({row:t})=>e.jsx("span",{className:"text-neutral-700",children:n(t.original.message)})},{id:"date",header:"Date",meta:{width:"170px"},cell:({row:t})=>e.jsx("span",{className:"text-neutral-700",children:t.original.createdAt})}];function d(){const[i,n]=t.useState(1),{data:d,isLoading:c,error:m}=s(i,15),x=null==d?void 0:d.data,[u,p]=t.useState(!1),[g,h]=t.useState(null),b=t.useCallback(e=>{h(e),p(!0)},[]),j=t.useMemo(()=>[...o,{id:"view",header:"",meta:{width:"80px",align:"right"},cell:({row:t})=>e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),b(t.original)},className:"rounded-md bg-gray-800 px-2.5 py-1 text-xs font-semibold text-white hover:bg-gray-700",children:"View"})}],[b]),f=i>1,y=15===((null==x?void 0:x.length)??0);return e.jsxs("div",{className:"px-4 py-6",children:[e.jsx(r,{title:"Feedback",description:"View & Manage user feedback",isLoading:c,statValue:(null==x?void 0:x.length)||0,statLabel:"Feedback this page"}),e.jsx(a,{columns:j,data:x,isLoading:c,error:m,onRowClick:b,emptyMessage:"No feedback found."}),e.jsxs("div",{className:"mt-3 flex items-center justify-between rounded-lg border border-neutral-200 bg-neutral-50 px-4 py-3",children:[e.jsxs("p",{className:"text-xs text-neutral-600",children:["Page ",i]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>f&&n(e=>Math.max(1,e-1)),disabled:!f||c,className:"rounded-md px-3 py-1.5 text-xs font-semibold border "+(!f||c?"bg-neutral-100 text-neutral-400 border-neutral-200 cursor-not-allowed":"bg-white text-neutral-700 border-neutral-300 hover:bg-neutral-100"),children:"Previous"}),e.jsx("button",{type:"button",onClick:()=>y&&n(e=>e+1),disabled:!y||c,className:"rounded-md px-3 py-1.5 text-xs font-semibold border "+(!y||c?"bg-neutral-100 text-neutral-400 border-neutral-200 cursor-not-allowed":"bg-white text-neutral-700 border-neutral-300 hover:bg-neutral-100"),children:"Next"})]})]}),e.jsx(l,{open:u,setOpen:p,feedback:g})]})}
1export{d 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.