import{d as p,k as _,c as o,l as c,b as t,h as x,F as f,m as h,n as b,j as v,o as r,e as y,t as n}from"./index-BvsGCd9b.js";import{u as k}from"./data-C_m0Mceb.js";import{_ as g}from"./TopBar.vue_vue_type_script_setup_true_lang-CtReUXIV.js";import{_ as w}from"./BottomNav.vue_vue_type_script_setup_true_lang-Bb1Ze8Sv.js";const D={class:"pb-32 min-h-dvh"},N={class:"max-w-md mx-auto px-4 pt-2"},C={key:0,class:"text-center py-12 text-ink-muted"},S=["onClick"],V={class:"flex items-start justify-between gap-3"},$={class:"min-w-0"},j={class:"font-bold"},B={class:"text-meta text-ink-muted truncate"},F={class:"px-2 py-0.5 rounded-pill text-[10px] font-bold uppercase bg-brand-100 text-brand-700 shrink-0"},L={class:"mt-2 flex items-center justify-between text-meta text-ink-muted"},O={class:"tabular-nums font-semibold text-ink"},A=p({__name:"OrdersView",setup(R){const i=k(),l=v();_(()=>i.loadOrders());const d=b(()=>i.orders??[]),m=a=>a.toLocaleString(void 0,{maximumFractionDigits:2});function u(a){if(!a)return"";const s=new Date(a);return isNaN(s.getTime())?"":s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}return(a,s)=>(r(),o("div",D,[c(g),t("main",N,[s[1]||(s[1]=t("h1",{class:"text-display py-4"},"Repair orders",-1)),d.value.length===0?(r(),o("div",C,[...s[0]||(s[0]=[t("div",{class:"text-5xl mb-3 opacity-60"},"🔧",-1),t("p",{class:"text-meta"},"No repair orders yet.",-1)])])):x("",!0),(r(!0),o(f,null,h(d.value,e=>(r(),o("article",{key:e.id,class:"rounded-card bg-surface shadow-card p-4 mb-3 active:scale-[0.99] transition cursor-pointer",onClick:E=>y(l).push(`/orders/${e.id}`)},[t("div",V,[t("div",$,[t("div",j,n(e.number),1),t("div",B,n(e.vehicle||"—"),1)]),t("span",F,n(e.status_label||e.status),1)]),t("div",L,[t("span",null,n(u(e.updated_at)),1),t("span",O,n(m(e.grand_total)),1)])],8,S))),128))]),c(w)]))}});export{A as default};
//# sourceMappingURL=OrdersView-na4TO8ot.js.map
