1import{j as e,cu as m,L as p,Q as b}from"./vendor-ui-fc56ca80.js";import{i as f,e as j,r as a}from"./vendor-react-f9ccc48d.js";import{J as y}from"./index-90016d22.js";import"./vendor-firebase-a557f106.js";import"./vendor-utils-323b9898.js";import"./vendor-charts-9af8b7c0.js";function E(){const{id:o}=f(),r=j(),[t,s]=a.useState("input"),[i,x]=a.useState(""),[u,l]=a.useState(""),[c,d]=a.useState(!1),g=async n=>{if(n.preventDefault(),!o){s("error"),l("ID de asignación no válido");return}d(!0),s("loading");try{await y.declineAssignment(o,i||void 0),s("success"),setTimeout(()=>{r("/")},3e3)}catch(h){console.error("Error declining assignment:",h),s("error"),l("No se pudo rechazar la asignación. Por favor intenta de nuevo."),d(!1)}};return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-slate-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-xl p-8",children:[t==="input"&&e.jsxs("div",{children:[e.jsx("div",{className:"w-16 h-16 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(m,{className:"w-10 h-10 text-amber-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2 text-center",children:"No puedo asistir"}),e.jsx("p",{className:"text-gray-600 mb-6 text-center",children:"Lamentamos que no puedas asistir. Por favor, déjanos saber la razón (opcional)."}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"reason",className:"block text-sm font-medium text-gray-700 mb-2",children:"Razón (opcional)"}),e.jsx("textarea",{id:"reason",value:i,onChange:n=>x(n.target.value),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-sky-500 focus:border-transparent resize-none",rows:4,placeholder:"Ej: Tengo un compromiso familiar, estaré de viaje, etc."})]}),e.jsx("button",{type:"submit",disabled:c,className:"w-full bg-gray-600 hover:bg-gray-700 disabled:bg-gray-400 text-white font-medium py-3 px-4 rounded-lg transition-colors",children:c?"Procesando...":"Confirmar que no puedo asistir"}),e.jsx("button",{type:"button",onClick:()=>r("/"),className:"w-full text-gray-600 hover:text-gray-800 font-medium py-2 transition-colors",children:"Cancelar"})]})]}),t==="loading"&&e.jsxs("div",{className:"text-center",children:[e.jsx(p,{className:"w-16 h-16 text-gray-500 animate-spin mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Procesando..."}),e.jsx("p",{className:"text-gray-600",children:"Por favor espera un momento"})]}),t==="success"&&e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(b,{className:"w-10 h-10 text-green-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Respuesta registrada"}),e.jsx("p",{className:"text-gray-600 mb-6",children:"Gracias por avisar. El equipo ha sido notificado."}),e.jsx("div",{className:"bg-sky-50 border border-sky-200 rounded-lg p-4",children:e.jsx("p",{className:"text-sm text-sky-800",children:"Serás redirigido a la página principal en unos segundos..."})})]}),t==="error"&&e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(m,{className:"w-10 h-10 text-red-600"})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Error al procesar"}),e.jsx("p",{className:"text-gray-600 mb-6",children:u}),e.jsx("button",{onClick:()=>s("input"),className:"w-full bg-sky-500 hover:bg-sky-600 text-white font-medium py-3 px-4 rounded-lg transition-colors mb-2",children:"Intentar de nuevo"}),e.jsx("button",{onClick:()=>r("/"),className:"w-full text-gray-600 hover:text-gray-800 font-medium py-2 transition-colors",children:"Ir a página principal"})]})]})})}export{E 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.