PageSourceSearch

https://www.ecomdroptv.com/assets/AdminCustomRequestsPage-BBiq-BT4.js

js ecomdroptv.com collected 2026-09-24 14:42:43 UTC 5,507 bytes, 1 lines download raw bytes

1import{u as E,j as t}from"./index-C6-4kgOT.js";import{r as a}from"./vendor-react--UDKce57.js";const l=[{key:"all",label:"Todas",color:"#94A3B8"},{key:"pending",label:"En espera",color:"#94A3B8"},{key:"reviewing",label:"Revisando",color:"#6366F1"},{key:"approved",label:"Aprobadas",color:"#10B981"},{key:"in_progress",label:"En desarrollo",color:"#F59E0B"},{key:"done",label:"Listas",color:"#10B981"},{key:"rejected",label:"No viables",color:"#94A3B8"}];function C(){const p=E(),[i,S]=a.useState("all"),[u,j]=a.useState([]),[x,g]=a.useState(!0),[s,d]=a.useState(null),[y,b]=a.useState("pending"),[f,m]=a.useState(""),[c,h]=a.useState(!1),v=async()=>{g(!0);try{const e=i==="all"?"":`?status=${i}`,n=await(await p(`/api/admin/custom-requests${e}`)).json();j(n.requests||[])}finally{g(!1)}};a.useEffect(()=>{v()},[i]);const k=e=>{d(e.id),b(e.status),m(e.admin_note||"")},z=async()=>{if(s!=null){h(!0);try{await p(`/api/admin/custom-requests/${s}`,{method:"PATCH",body:JSON.stringify({status:y,admin_note:f||null})}),d(null),v()}finally{h(!1)}}};return t.jsxs("div",{style:{padding:"20px 24px",maxWidth:1100,margin:"0 auto"},children:[t.jsxs("h1",{style:{fontSize:22,fontWeight:800,margin:0,color:"var(--text-primary)",marginBottom:16,display:"flex",alignItems:"center",gap:10},children:[t.jsx("span",{style:{fontSize:26},children:"🛠️"})," Solicitudes de desarrollo"]}),t.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:16},children:l.map(e=>{const o=i===e.key;return t.jsx("button",{onClick:()=>S(e.key),style:{padding:"5px 12px",borderRadius:18,fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"inherit",border:`1px solid ${o?e.color:"var(--border)"}`,background:o?`${e.color}18`:"transparent",color:o?e.color:"var(--text-muted)"},children:e.label},e.key)})}),x&&t.jsx("div",{style:{padding:20,color:"var(--text-muted)",fontSize:13},children:"Cargando…"}),!x&&u.length===0&&t.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-muted)",fontSize:13},children:"Sin solicitudes con este filtro."}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:u.map(e=>{const o=l.find(r=>r.key===e.status)||l[0],n=s===e.id;return t.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:10,padding:16},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10,marginBottom:8},children:[t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:{fontWeight:700,fontSize:14,color:"var(--text-primary)"},children:e.title}),t.jsxs("div",{style:{fontSize:11.5,color:"var(--text-muted)",marginTop:2},children:["De: ",t.jsx("b",{children:e.user_email})," ",e.user_name?`(${e.user_name})`:""," · ",new Date(e.created_at+"Z").toLocaleString("es-CO",{dateStyle:"medium",timeStyle:"short"}),e.category&&` · 📂 ${e.category}`]})]}),t.jsx("span",{style:{fontSize:10,fontWeight:800,color:o.color,background:`${o.color}18`,padding:"3px 8px",borderRadius:4,letterSpacing:"0.05em",textTransform:"uppercase",whiteSpace:"nowrap"},children:o.label})]}),t.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",lineHeight:1.55,whiteSpace:"pre-wrap",marginBottom:10},children:e.description}),e.admin_note&&!n&&t.jsxs("div",{style:{padding:"8px 10px",background:"rgba(99,102,241,0.08)",border:"1px solid rgba(99,102,241,0.18)",borderRadius:8,fontSize:12,color:"var(--text-primary)",marginBottom:10},children:[t.jsx("b",{style:{color:"#6366F1"},children:"Nota visible al user:"})," ",e.admin_note]}),n?t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:10,background:"var(--bg-tertiary)",borderRadius:8},children:[t.jsxs("label",{style:{fontSize:11,fontWeight:700,color:"var(--text-secondary)"},children:["Estado",t.jsx("select",{value:y,onChange:r=>b(r.target.value),style:{display:"block",marginTop:4,padding:"6px 8px",width:"100%",borderRadius:6,border:"1px solid var(--border)",background:"var(--bg-card)",fontSize:12,fontFamily:"inherit",color:"var(--text-primary)"},children:l.filter(r=>r.key!=="all").map(r=>t.jsx("option",{value:r.key,children:r.label},r.key))})]}),t.jsxs("label",{style:{fontSize:11,fontWeight:700,color:"var(--text-secondary)"},children:["Nota visible al user (opcional)",t.jsx("textarea",{value:f,onChange:r=>m(r.target.value),rows:3,placeholder:'Ej: "Lo aprobamos. Sale en la próxima release." o "No es viable porque…"',style:{display:"block",marginTop:4,padding:"8px 10px",width:"100%",borderRadius:6,border:"1px solid var(--border)",background:"var(--bg-card)",fontSize:12,fontFamily:"inherit",color:"var(--text-primary)",resize:"vertical"}})]}),t.jsxs("div",{style:{display:"flex",gap:6},children:[t.jsx("button",{onClick:z,disabled:c,style:{padding:"7px 14px",border:"none",borderRadius:6,background:"#6366F1",color:"#fff",fontSize:12,fontWeight:700,cursor:"pointer",fontFamily:"inherit",opacity:c?.6:1},children:c?"Guardando…":"Guardar"}),t.jsx("button",{onClick:()=>d(null),style:{padding:"7px 14px",border:"1px solid var(--border)",borderRadius:6,background:"transparent",color:"var(--text-secondary)",fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},children:"Cancelar"})]})]}):t.jsx("button",{onClick:()=>k(e),style:{padding:"6px 12px",border:"1px solid var(--border)",borderRadius:6,background:"transparent",color:"var(--text-secondary)",fontSize:11.5,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},children:"Actualizar estado / nota"})]},e.id)})})]})}export{C as AdminCustomRequestsPage};

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.