1import{j as e}from"./ui-vendor-B12AOeKi.js";import{e as j,r as f}from"./react-vendor-DZt7wVAJ.js";import{s as d,P as w,q as p,C as g,g as N}from"./index-BZo64Z7H.js";import"./charts-vendor-B6q1L48j.js";import"./supabase-vendor-dOy44Gxq.js";import"./animation-vendor-BAVy02gd.js";function k(){const _=j(),[n,m]=f.useState(null);return f.useEffect(()=>{(async()=>{var v;const{data:t}=await d.auth.getUser(),a=(v=t.user)==null?void 0:v.id;if(!a){m([]);return}const{data:s}=await d.from("registration_users").select("id").eq("auth_uid",a).maybeSingle(),c=s==null?void 0:s.id,{data:o,error:l}=await d.from("m360_posting_queue").select(`id, vehicle_id, status, created_at, 2 vehicle:m360_vehicles!inner(year, make, model, vin, mileage, exterior_color, source_type)`).eq("assigned_user_id",c||"00000000-0000-0000-0000-000000000000").order("created_at",{ascending:!1}).limit(100);if(l){console.error(l),m([]);return}const r=o||[],x=r.map(i=>i.vehicle_id);let h={};if(x.length){const{data:i}=await d.from("m360_vehicle_images").select("vehicle_id, url, sort_order").in("vehicle_id",x).order("sort_order",{ascending:!0});for(const u of i||[])h[u.vehicle_id]||(h[u.vehicle_id]=u.url)}m(r.map(i=>({...i,cover:h[i.vehicle_id]||null})))})()},[]),n===null?e.jsx("div",{className:"p-8 flex justify-center",children:e.jsx(w,{className:"h-6 w-6 animate-spin text-[#2F80ED]"})}):e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"pt-1",children:[e.jsx("div",{className:"text-xl font-semibold text-[#E6EDF3]",children:"My Queue"}),e.jsx("div",{className:"text-sm text-[#9FB3C8]",children:"Vehicles you've added."})]}),n.length===0&&e.jsxs(p,{className:"p-6 text-center bg-white/[0.03] border-white/10 text-[#9FB3C8]",children:[e.jsx(g,{className:"h-8 w-8 mx-auto mb-2 opacity-60"}),"No vehicles yet. Tap Add to get started."]}),n.map(t=>{var a,s,c,o,l,r;return e.jsxs(p,{onClick:()=>_(`/marketplace360/inventory/${t.vehicle_id}`),className:"cursor-pointer overflow-hidden p-3 flex gap-3 bg-white/[0.03] border-white/10 text-[#E6EDF3] active:bg-white/[0.06]",children:[e.jsx("div",{className:"h-16 w-16 rounded-md bg-black/30 overflow-hidden flex-shrink-0",children:t.cover?e.jsx("img",{src:t.cover,alt:"",className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-[#9FB3C8]",children:e.jsx(g,{className:"h-6 w-6"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"font-medium truncate",children:[(a=t.vehicle)==null?void 0:a.year," ",(s=t.vehicle)==null?void 0:s.make," ",(c=t.vehicle)==null?void 0:c.model]}),e.jsx("div",{className:"text-xs text-[#9FB3C8] truncate font-mono",children:(o=t.vehicle)==null?void 0:o.vin}),e.jsxs("div",{className:"text-xs text-[#B8C7D9] mt-0.5",children:[(l=t.vehicle)!=null&&l.mileage?Number(t.vehicle.mileage).toLocaleString()+" mi":"",(r=t.vehicle)!=null&&r.exterior_color?` · ${t.vehicle.exterior_color}`:""]})]}),e.jsx(N,{variant:"outline",className:"self-start border-white/20 text-[#B8C7D9] capitalize",children:t.status})]},t.id)})]})}export{k 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.