import{g as l,b as e,F as c,r as m,c as v,n as b,e as u,l as p,i as w,o,d as i,a as d,f as x,j as _,h as y,v as C,k as T,t as n,q as k}from"./app-BJF24m-a.js";import{P as M}from"./PrimaryButton-5AnCxPpY.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const V={key:0},B={class:"flex flex-wrap -mb-1"},S=["innerHTML"],N={__name:"Pagination",props:{links:Array},setup(r){return(f,g)=>r.links.length>3?(o(),l("div",V,[e("div",B,[(o(!0),l(c,null,m(r.links,(a,t)=>(o(),l(c,null,[a.url===null?(o(),l("div",{key:a.label,class:"mr-1 mb-1 px-3 py-2 text-sm text-gray-400",innerHTML:a.label},null,8,S)):(o(),v(u(p),{key:a.url||a.label,href:a.url,class:b(["mr-1 mb-1 px-3 py-2 text-sm border rounded hover:bg-gray-50",{"bg-brand-blue text-white":a.active}]),innerHTML:a.label},null,8,["href","class","innerHTML"]))],64))),256))])])):w("",!0)}},j={class:"min-h-screen bg-gray-50"},L={class:"bg-white shadow"},A={class:"max-w-7xl mx-auto py-4 sm:py-6 px-4 sm:px-6 lg:px-8 flex justify-between items-center"},H={class:"flex items-center gap-3 sm:gap-4"},O=["action"],P={class:"max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8"},$={class:"bg-white shadow rounded-lg p-4 mb-6"},z=["value"],D={class:"bg-white shadow rounded-lg"},E={class:"overflow-x-auto"},F={class:"min-w-full divide-y divide-gray-200"},U={class:"bg-white divide-y divide-gray-200"},q={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},G={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},I={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},J={class:"px-6 py-4 whitespace-nowrap"},K={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},Q={class:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},R={class:"px-6 py-4 border-t border-gray-200"},Z={__name:"Casos",props:{title:String,casos:Object,estados:Object,filtros:Object},setup(r){const f=()=>{k.get(route("portal.casos"),filtros.value||{})},g=a=>{const t={finalizado:"bg-green-100 text-green-800",en_reparacion:"bg-blue-100 text-blue-800",mesa_compras:"bg-purple-100 text-purple-800",rechazado:"bg-red-100 text-red-800",default:"bg-gray-100 text-gray-800"};return t[a]||t.default};return(a,t)=>(o(),l("div",j,[e("header",L,[e("div",A,[t[4]||(t[4]=e("h1",{class:"text-lg sm:text-2xl font-bold text-gray-900"},"Mis Casos",-1)),e("div",H,[i(u(p),{href:a.route("portal.dashboard"),class:"text-sm sm:text-base text-blue-600 hover:underline"},{default:d(()=>[...t[2]||(t[2]=[x("Dashboard",-1)])]),_:1},8,["href"]),e("form",{method:"POST",action:a.route("portal.logout")},[...t[3]||(t[3]=[e("button",{type:"submit",class:"text-sm sm:text-base text-gray-600 hover:text-gray-900"},"Cerrar Sesión",-1)])],8,O)])])]),e("main",P,[e("div",$,[e("form",{onSubmit:_(f,["prevent"]),class:"flex flex-col sm:flex-row gap-3 sm:gap-4"},[y(e("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>r.filtros.search=s),type:"text",placeholder:"Buscar por placa o número de caso...",class:"flex-1 border rounded px-4 py-2"},null,512),[[C,r.filtros.search]]),y(e("select",{"onUpdate:modelValue":t[1]||(t[1]=s=>r.filtros.estado=s),class:"border rounded px-4 py-2"},[t[5]||(t[5]=e("option",{value:""},"Todos los estados",-1)),(o(!0),l(c,null,m(r.estados,(s,h)=>(o(),l("option",{key:h,value:h},n(s),9,z))),128))],512),[[T,r.filtros.estado]]),i(M,{type:"submit"},{default:d(()=>[...t[6]||(t[6]=[x("Buscar",-1)])]),_:1})],32)]),e("div",D,[e("div",E,[e("table",F,[t[9]||(t[9]=e("thead",{class:"bg-gray-50"},[e("tr",null,[e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Caso"),e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Vehículo"),e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Cliente"),e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Estado"),e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Fecha Siniestro"),e("th",{class:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase"},"Acciones")])],-1)),e("tbody",U,[(o(!0),l(c,null,m(r.casos.data,s=>(o(),l("tr",{key:s.id},[e("td",q,n(s.numero_reclamo),1),e("td",G,n(s.vehiculo?.placa||"N/A"),1),e("td",I,n(s.cliente?.nombre||"N/A"),1),e("td",J,[e("span",{class:b([g(s.estado_actual),"px-2 inline-flex text-xs leading-5 font-semibold rounded-full"])},n(r.estados[s.estado_actual]||s.estado_actual),3)]),e("td",K,n(s.fecha_siniestro),1),e("td",Q,[i(u(p),{href:a.route("portal.casos.ver",s.id),class:"text-blue-600 hover:text-blue-900 mr-3"},{default:d(()=>[...t[7]||(t[7]=[x(" Ver ",-1)])]),_:1},8,["href"]),i(u(p),{href:a.route("portal.casos.timeline",s.id),class:"text-green-600 hover:text-green-900"},{default:d(()=>[...t[8]||(t[8]=[x(" Timeline ",-1)])]),_:1},8,["href"])])]))),128))])])]),e("div",R,[i(N,{links:r.casos.links},null,8,["links"])])])])]))}};export{Z as default};
