PageSourceSearch

https://luxuryleasing.de/assets/Dashboard-CAikIJjN.js

js luxuryleasing.de collected 2026-10-08 07:12:35 UTC 9,088 bytes, 1 lines download raw bytes

1import{j as e,u as b}from"./query-vendor-DVmmQ-ki.js";import{supabase as v}from"./client-BXzYhP5O.js";import{C as n,a as d,b as x,c as f}from"./card-DwBoygcx.js";import{B as y}from"./badge-BrFuXnAq.js";import{v as w}from"./index-DpP3iEYK.js";import"./table-DGTNs8pb.js";import{S as l}from"./skeleton-CbBeDtzP.js";import{C as N}from"./car-DDzoQZ-u.js";import{C}from"./circle-check-BavTUs4p.js";import{T as k}from"./trending-up-B_zRYNKG.js";import{C as _}from"./circle-alert-BGAtDceg.js";import"./react-vendor-BURXZ51T.js";import"./supabase-DxfZiqN5.js";import"./radix-slot-BTvEbTmE.js";function D(){return e.jsx(n,{variant:"glass",className:"overflow-hidden",children:e.jsxs(d,{className:"p-0",children:[e.jsx(l,{className:"aspect-video w-full"}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx(l,{className:"h-5 w-3/4 mb-2"}),e.jsx(l,{className:"h-4 w-1/2"})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border/50",children:[e.jsxs("div",{children:[e.jsx(l,{className:"h-3 w-12 mb-1"}),e.jsx(l,{className:"h-8 w-20"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx(l,{className:"h-3 w-12 mb-1"}),e.jsx(l,{className:"h-6 w-16"})]})]})]})]})})}function S(){return e.jsx("div",{className:"space-y-3",children:[...Array(5)].map((t,h)=>e.jsxs("div",{className:"flex items-center justify-between py-4 px-4 rounded-lg border border-border/30",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{className:"h-4 w-48"}),e.jsx(l,{className:"h-3 w-24"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{className:"h-5 w-16 rounded-full"}),e.jsx(l,{className:"h-3 w-20"})]})]},h))})}function Q(){var u,p;const{data:t,isLoading:h}=b({queryKey:["vehicles-stats"],queryFn:async()=>{const{data:s,error:r}=await v.from("vehicles").select("*, pricing(*), link_monitor(*)");if(r)throw r;return s}}),i={total:(t==null?void 0:t.length)||0,live:(t==null?void 0:t.filter(s=>s.status==="live").length)||0,draft:(t==null?void 0:t.filter(s=>s.status==="draft").length)||0,online:(t==null?void 0:t.filter(s=>{var r,a;return((a=(r=s.link_monitor)==null?void 0:r[0])==null?void 0:a.status)==="online"}).length)||0},g=((p=(u=t==null?void 0:t.filter(s=>{var r,a;return(a=(r=s.pricing)==null?void 0:r[0])==null?void 0:a.factor}))==null?void 0:u.sort((s,r)=>{var a,c,o,m;return(((c=(a=s.pricing)==null?void 0:a[0])==null?void 0:c.factor)||999)-(((m=(o=r.pricing)==null?void 0:o[0])==null?void 0:m.factor)||999)}))==null?void 0:p.slice(0,3))||[];return e.jsx("div",{className:"luxury-bg-enhanced min-h-screen",children:e.jsxs("div",{className:"p-6 space-y-8",children:[e.jsx("div",{className:"relative",children:e.jsxs(n,{variant:"glass",className:"p-8 mb-8 overflow-hidden",children:[e.jsxs("div",{className:"relative z-10",children:[e.jsx("h1",{className:"text-5xl font-semibold tracking-tight mb-3 bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text text-transparent",children:"Dashboard"}),e.jsx("p",{className:"text-lg text-muted-foreground",children:"Overview of your luxury vehicle inventory"})]}),e.jsx("div",{className:"absolute top-0 right-0 w-1/3 h-full bg-gradient-to-l from-accent/10 to-transparent pointer-events-none"})]})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-4",children:[e.jsxs(n,{variant:"floating",className:"group glass-panel",children:[e.jsxs(x,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[e.jsx(f,{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Total Vehicles"}),e.jsx("div",{className:"p-2 rounded-lg bg-primary/10 group-hover:bg-primary/20 transition-colors",children:e.jsx(N,{className:"h-5 w-5 text-primary"})})]}),e.jsxs(d,{children:[e.jsx("div",{className:"text-4xl font-bold mb-2",children:i.total}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.live," live · ",i.draft," draft"]})]})]}),e.jsxs(n,{variant:"floating",className:"group glass-panel",children:[e.jsxs(x,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[e.jsx(f,{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Live Offers"}),e.jsx("div",{className:"p-2 rounded-lg bg-success/10 group-hover:bg-success/20 transition-colors",children:e.jsx(C,{className:"h-5 w-5 text-success"})})]}),e.jsxs(d,{children:[e.jsx("div",{className:"text-4xl font-bold mb-2",children:i.live}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Published and active"})]})]}),e.jsxs(n,{variant:"floating",className:"group glass-panel",children:[e.jsxs(x,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[e.jsx(f,{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Online Status"}),e.jsx("div",{className:"p-2 rounded-lg bg-accent/20 group-hover:bg-accent/30 transition-colors",children:e.jsx(k,{className:"h-5 w-5 text-accent-foreground"})})]}),e.jsxs(d,{children:[e.jsx("div",{className:"text-4xl font-bold mb-2",children:i.online}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.total>0?`${Math.round(i.online/i.total*100)}%`:"0%"," ","availability"]})]})]}),e.jsxs(n,{variant:"floating",className:"group glass-panel",children:[e.jsxs(x,{className:"flex flex-row items-center justify-between space-y-0 pb-3",children:[e.jsx(f,{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Draft Status"}),e.jsx("div",{className:"p-2 rounded-lg bg-warning/10 group-hover:bg-warning/20 transition-colors",children:e.jsx(_,{className:"h-5 w-5 text-warning"})})]}),e.jsxs(d,{children:[e.jsx("div",{className:"text-4xl font-bold mb-2",children:i.draft}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending review"})]})]})]}),g.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-tight mb-2",children:"Best Leasing Offers"}),e.jsx("p",{className:"text-muted-foreground",children:"Top vehicles by leasing factor"})]}),e.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:h?e.jsx(e.Fragment,{children:[...Array(3)].map((s,r)=>e.jsx(D,{},r))}):g.length===0?e.jsx(n,{variant:"glass",className:"col-span-full",children:e.jsx(d,{className:"text-center py-12 text-muted-foreground",children:"No offers available yet"})}):g.map((s,r)=>{var a,c,o,m,j;return e.jsx(n,{variant:"glass",className:"group overflow-hidden hover-lift cursor-pointer",children:e.jsxs(d,{className:"p-0",children:[e.jsxs("div",{className:"relative aspect-video bg-gradient-to-br from-muted to-muted/50 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(N,{className:"h-16 w-16 text-muted-foreground
1/30"})}),e.jsx("div",{className:"absolute top-4 left-4",children:e.jsxs("div",{className:"flex h-10 w-10 items-center justify-center rounded-full glass-card font-bold text-accent-foreground",children:["#",r+1]})})]}),e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-2 line-clamp-2 group-hover:text-primary transition-colors",children:s.title}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s.make," • ",s.model_family]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Factor"}),e.jsx("span",{className:"font-bold text-2xl text-accent-foreground",children:((o=(c=(a=s.pricing)==null?void 0:a[0])==null?void 0:c.factor)==null?void 0:o.toFixed(4))||"N/A"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Monthly"}),e.jsxs("span",{className:"text-lg font-semibold",children:["€",w(((j=(m=s.pricing)==null?void 0:m[0])==null?void 0:j.rate_rounded_gross)||0).toLocaleString("de-DE")]})]})]})]})]})},s.id)})})]}),e.jsxs(n,{variant:"glass",children:[e.jsxs(x,{children:[e.jsx(f,{className:"text-2xl font-semibold",children:"Recent Changes"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Last 5 modified vehicles"})]}),e.jsx(d,{children:h?e.jsx(S,{}):!t||t.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No vehicles yet"}):e.jsx("div",{className:"space-y-3",children:t.slice(0,5).map(s=>e.jsxs("div",{className:"flex items-center justify-between py-4 px-4 rounded-lg hover:bg-background/50 transition-colors border border-border/30",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.offer_no})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(y,{variant:s.status==="live"?"default":"secondary",children:s.status}),e.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(s.updated_at||"").toLocaleDateString()})]})]},s.id))})})]})]})})}export{Q 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.