import{j as d,y as m,k as p,m as v,z as l,B as r,O as h,l as t,D as k,r as w,A as n,H as _,t as a,I as y,P as C,h as A,o as x}from"./index-B8bqNNwo.js";import{W as j}from"./wrench-Cp-0t4si.js";import{A as N}from"./activity-BHBuRjgX.js";const V={key:0,class:"flex items-center justify-center min-h-screen bg-slate-50"},S={key:1,class:"p-6 space-y-6 bg-slate-50 min-h-screen"},T={class:"flex flex-col md:flex-row md:items-center justify-between gap-4"},B={class:"flex mb-2 text-[10px] font-black text-slate-400 uppercase tracking-widest"},M={class:"text-2xl font-black text-slate-800 flex items-center gap-3 tracking-tighter uppercase"},D={class:"w-12 h-12 rounded-2xl bg-slate-800 text-white flex items-center justify-center font-black text-lg shadow-xl"},L={class:"flex gap-3"},z={class:"px-6 py-3 bg-white text-slate-700 border border-slate-200 rounded-2xl shadow-sm font-black text-xs uppercase flex items-center gap-2"},F={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},P={class:"bg-white p-5 rounded-2xl border border-slate-200 shadow-sm"},U={class:"text-lg font-black text-slate-800 uppercase"},W={class:"text-[9px] font-bold text-slate-400 mt-1 uppercase"},E={class:"bg-white p-5 rounded-2xl border border-slate-200 shadow-sm"},H={class:"text-lg font-black text-indigo-600 uppercase"},I={class:"bg-white p-5 rounded-2xl border border-slate-200 shadow-sm"},O={class:"text-2xl font-black text-slate-800"},R={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Y={class:"lg:col-span-1 bg-white p-6 rounded-2xl border border-slate-200 shadow-sm"},$={class:"space-y-4"},q={class:"flex justify-between items-center text-sm"},G={class:"font-black text-slate-700 uppercase"},J={class:"flex justify-between items-center text-sm"},K={class:"font-black text-indigo-600 uppercase"},Q={class:"lg:col-span-2 bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden"},X={class:"p-20 text-center"},st={__name:"Show",props:["id"],setup(u){const b=u,s=d(null),i=d({}),c=d(!0);async function g(){c.value=!0;try{const{data:o}=await A.get(`/portal/vehicles/${b.id}`);s.value=o.vehicle,i.value=o.stats}catch(o){console.error(o)}finally{c.value=!1}}return m(g),(o,e)=>{const f=w("router-link");return c.value?(x(),p("div",V,[l(r(h),{class:"w-10 h-10 text-indigo-600 animate-spin"})])):s.value?(x(),p("div",S,[t("div",T,[t("div",null,[t("nav",B,[l(f,{to:"/vehicles",class:"hover:text-indigo-600"},{default:k(()=>[...e[0]||(e[0]=[n("Fleet",-1)])]),_:1}),e[1]||(e[1]=t("span",{class:"mx-2"},"/",-1)),e[2]||(e[2]=t("span",{class:"text-indigo-600"},"Vehicle Unit",-1))]),t("h1",M,[t("div",D,[l(r(_),{class:"w-6 h-6"})]),n(" "+a(s.value.plate_number),1)])]),t("div",L,[t("button",z,[l(r(j),{class:"w-4 h-4"}),e[3]||(e[3]=n(" Service Log ",-1))]),t("button",{class:y([s.value.status==="active"?"bg-green-600":"bg-orange-500","px-6 py-3 text-white rounded-2xl shadow-xl font-black text-xs uppercase flex items-center gap-2"])},[l(r(N),{class:"w-4 h-4"}),n(" "+a(s.value.status),1)],2)])]),t("div",F,[t("div",P,[e[4]||(e[4]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1"},"Make / Model",-1)),t("p",U,a(s.value.make)+" "+a(s.value.model),1),t("p",W,"Year: "+a(s.value.year||"N/A"),1)]),t("div",E,[e[5]||(e[5]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1"},"Current Driver",-1)),t("p",H,a(i.value.current_driver||"Unassigned"),1),e[6]||(e[6]=t("p",{class:"text-[9px] font-bold text-slate-400 mt-1 uppercase"},"Active Assignment",-1))]),t("div",I,[e[7]||(e[7]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1"},"Total Trips",-1)),t("p",O,a(i.value.total_trips||0),1)]),e[8]||(e[8]=t("div",{class:"bg-white p-5 rounded-2xl border border-slate-200 shadow-sm"},[t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1"},"Fuel Consumed"),t("p",{class:"text-2xl font-black text-slate-800"},[n("0 "),t("span",{class:"text-xs text-slate-400 uppercase"},"Ltrs")])],-1))]),t("div",R,[t("div",Y,[e[11]||(e[11]=t("h3",{class:"text-xs font-black text-slate-900 uppercase tracking-tighter mb-6 border-b pb-4"},"Specifications",-1)),t("div",$,[t("div",q,[e[9]||(e[9]=t("span",{class:"text-[10px] font-black text-slate-400 uppercase"},"Color",-1)),t("span",G,a(s.value.color),1)]),t("div",J,[e[10]||(e[10]=t("span",{class:"text-[10px] font-black text-slate-400 uppercase"},"Status",-1)),t("span",K,a(s.value.status),1)])])]),t("div",Q,[e[13]||(e[13]=t("div",{class:"p-6 border-b border-slate-50"},[t("h3",{class:"text-xs font-black text-slate-900 uppercase tracking-tighter"},"Recent Trip Activity")],-1)),t("div",X,[l(r(C),{class:"w-12 h-12 text-slate-200 mx-auto mb-4"}),e[12]||(e[12]=t("p",{class:"text-[10px] font-black text-slate-400 uppercase tracking-widest"},"No recent trip data for this unit",-1))])])])])):v("",!0)}}};export{st as default};
