1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[1652],{5968:function(e,t){var n,r=null===(n={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_API_URL)||void 0===n?void 0:n.trim(),a={urlServer:r||"http://localhost:8000"},s={urlServer:r||window.location.origin},i=window.location.href.match("localhost")?a:s;t.Z=i},1652:function(e,t,n){n.r(t),n.d(t,{ExperiencesPage:function(){return p},default:function(){return h}});var r=n(5861),a=n(9439),s=n(4687),i=n.n(s),c=n(7313),o=n(1718),u=function(){var e=(0,r.Z)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.Z.get("/api/experiences");case 2:return t=e.sent,e.abrupt("return",t.data||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=function(){var e=(0,r.Z)(i().mark((function e(t,n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.Z.put("/api/experiences/".concat(t,"/status"),{status:n});case 2:return r=e.sent,e.abrupt("return",r.data);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),d=n(6417),p=function(){var e=(0,c.useState)([]),t=(0,a.Z)(e,2),n=t[0],s=t[1],o=(0,c.useState)(!1),p=(0,a.Z)(o,2),h=p[0],f=p[1],x=(0,c.useCallback)((0,r.Z)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,f(!0),e.next=4,u();case 4:t=e.sent,s(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),alert(e.t0.message||"N\xe3o foi poss\xedvel carregar experi\xeancias.");case 11:return e.prev=11,f(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])}
1))),[]);(0,c.useEffect)((function(){x()}),[x]);var v=function(){var e=(0,r.Z)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l(t.id,n);case 3:return e.next=5,x();case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),alert(e.t0.message||"N\xe3o foi poss\xedvel atualizar o status.");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t,n){return e.apply(this,arguments)}}();return(0,d.jsx)("div",{className:"admin-content",children:(0,d.jsxs)("div",{className:"content-section",children:[(0,d.jsx)("h2",{children:"Experi\xeancias"}),(0,d.jsx)("p",{style:{marginTop:8,marginBottom:16,color:"#666"},children:"Painel administrativo para visualizar e responder solicita\xe7\xf5es de experi\xeancias dos clientes."}),h?(0,d.jsx)("p",{children:"Carregando experi\xeancias..."}):(0,d.jsx)("div",{className:"table-wrapper",children:(0,d.jsxs)("table",{className:"data-table",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{children:"Cliente"}),(0,d.jsx)("th",{children:"T\xedtulo"}),(0,d.jsx)("th",{children:"Detalhes"}),(0,d.jsx)("th",{children:"Data preferida"}),(0,d.jsx)("th",{children:"Status"}),(0,d.jsx)("th",{children:"A\xe7\xf5es"})]})}),(0,d.jsx)("tbody",{children:0===n.length?(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:6,className:"no-data",children:"Nenhuma solicita\xe7\xe3o cadastrada."})}):n.map((function(e){return(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:e.student?"".concat(e.student.first_name," ").concat(e.student.last_name):e.student_id}),(0,d.jsx)("td",{children:e.title}),(0,d.jsx)("td",{children:e.details||"-"}),(0,d.jsx)("td",{children:e.preferred_date||"-"}),(0,d.jsx)("td",{children:e.status}),(0,d.jsx)("td",{children:(0,d.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,d.jsx)("button",{className:"btn-icon",title:"Pendente",onClick:function(){return v(e,"pending")},children:"\ud83d\udd50"}),(0,d.jsx)("button",{className:"btn-icon",title:"Confirmar",onClick:function(){return v(e,"confirmed")},children:"\u2705"}),(0,d.jsx)("button",{className:"btn-icon delete",title:"Cancelar",onClick:function(){return v(e,"cancelled")},children:"\ud83d\udeab"})]})})]},e.id)}))})]})})]})})},h=p},1718:function(e,t,n){var r=n(1881),a=n.n(r),s=n(9884),i=n(5968),c=n(2933),o=a().create({baseURL:i.Z.urlServer,timeout:72e4,headers:{"Content-Type":"application/json"}});o.interceptors.request.use((function(e){var t=(0,s.$l)(c.Z).token;return t&&(e.headers.Authorization="Bearer ".concat(t)),e.data instanceof FormData&&delete e.headers["Content-Type"],e}),(function(e){return Promise.reject(e)})),o.interceptors.response.use((function(e){return e}),(function(e){var t;return 401===(null===(t=e.response)||void 0===t?void 0:t.status)&&((0,s.z8)(c.Z,{isAuthenticate:!1,token:"",user:null}),["#/"].includes(window.location.hash)||(window.location.hash="/")),Promise.reject(e)})),t.Z=o}}]);
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.