PageSourceSearch

https://b2b-solarics.lovable.app/assets/MarktmonitorPage-Da9oqbZR.js

js b2b-solarics.lovable.app collected 2026-10-03 05:35:35 UTC 7,978 bytes, 1 lines download raw bytes

1import{a as w,r as p,j as e}from"./index-DHSMMgQP.js";import{u as k}from"./useMarketSystem-CSqZO3Xr.js";import{C as c,c as d,a as _,b as C}from"./card-SmBWIJ6J.js";import{B as x}from"./button-BeDbJ6T4.js";import{B as m}from"./badge-D6fetf0E.js";import{T as z,a as P,b as h,c as a,d as M,e as i}from"./table-CKs-qlD9.js";import{A as S}from"./arrow-left-LNDHISHj.js";import{C as j}from"./chart-column-GkrNZm3u.js";import{U as T}from"./users-CaLMXnTN.js";import{P as D}from"./package-BpJx5bIZ.js";import{L}from"./loader-circle-D2F-RNS_.js";import{T as E}from"./trending-down--Ubav2hX.js";import{T as B}from"./trending-up-BY-ffEe8.js";function n(t){return t==null?"—":new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t)}function J(){const t=w(),{marketOverview:r,loading:f,fetchMarketOverview:g,fetchSupplierProducts:N,supplierProducts:u}=k(),[o,b]=p.useState(null);p.useEffect(()=>{g()},[]);const v=s=>{b(s),N({manufacturer:s})},y=[...r].sort((s,l)=>(l.product_count||0)-(s.product_count||0));return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"bg-primary text-primary-foreground",children:e.jsxs("div",{className:"w-full px-6 xl:px-8 py-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(x,{variant:"ghost",size:"sm",onClick:()=>t("/lieferanten"),className:"text-primary-foreground hover:bg-primary-foreground/10",children:[e.jsx(S,{size:16,className:"mr-1"})," Zurück"]}),e.jsx("div",{className:"h-8 w-px bg-primary-foreground/20"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold tracking-tight",children:"📊 Marktmonitor"}),e.jsx("p",{className:"text-xs text-primary-foreground/60",children:"Hersteller-Marktübersicht · Preisvergleich · Supplier-Transparenz"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>t("/neuheiten"),className:"text-primary-foreground/70 hover:bg-primary-foreground/10 text-xs",children:"🆕 Neuheiten"}),e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>t("/vollkatalog"),className:"text-primary-foreground/70 hover:bg-primary-foreground/10 text-xs",children:"📦 Vollkatalog"})]})]})}),e.jsxs("main",{className:"w-full px-6 xl:px-8 py-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(c,{children:e.jsxs(d,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(j,{size:20,className:"text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] text-muted-foreground font-medium uppercase",children:"Hersteller"}),e.jsx("p",{className:"text-2xl font-bold",children:r.length})]})]})}),e.jsx(c,{children:e.jsxs(d,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-secondary flex items-center justify-center",children:e.jsx(T,{size:20,className:"text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] text-muted-foreground font-medium uppercase",children:"Supplier gesamt"}),e.jsx("p",{className:"text-2xl font-bold",children:new Set(r.flatMap(s=>Array(s.supplier_count))).size||r.reduce((s,l)=>Math.max(s,l.supplier_count),0)})]})]})}),e.jsx(c,{children:e.jsxs(d,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-lg bg-secondary flex items-center justify-center",children:e.jsx(D,{size:20,className:"text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] text-muted-foreground font-medium uppercase",children:"Produkte gesamt"}),e.jsx("p",{className:"text-2xl font-bold",children:r.reduce((s,l)=>s+l.product_count,0)})]})]})})]}),f?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(L,{className:"animate-spin text-muted-foreground",size:28})}):r.length===0?e.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[e.jsx(j,{size:40,className:"mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"text-base font-medium",children:"Noch keine Marktdaten"}),e.jsx("p",{className:"text-sm mt-1",children:"Starte einen CCL Scan über den Neuheiten Monitor, um Daten zu erfassen."}),e.jsx(x,{size:"sm",variant:"outline",className:"mt-4",onClick:()=>t("/neuheiten"),children:"🆕 Zum Neuheiten Monitor"})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:y.map(s=>
1e.jsxs(c,{className:`cursor-pointer transition-all hover:shadow-md hover:border-primary/30 ${o===s.manufacturer?"border-primary shadow-md":""}`,onClick:()=>v(s.manufacturer),children:[e.jsx(_,{className:"pb-2",children:e.jsxs(C,{className:"text-sm font-bold flex items-center justify-between",children:[s.manufacturer||"Unbekannt",e.jsxs(m,{variant:"outline",className:"text-[10px]",children:[s.product_count," Produkte"]})]})}),e.jsxs(d,{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Supplier"}),e.jsx("span",{className:"font-medium",children:s.supplier_count})]}),e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Ø Preis"}),e.jsx("span",{className:"font-medium",children:n(s.avg_price)})]}),e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Best Price"}),e.jsx("span",{className:"font-semibold text-emerald-600",children:n(s.best_price)})]}),e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Max Price"}),e.jsx("span",{className:"text-red-500",children:n(s.max_price)})]}),s.last_price_change&&e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Letzte Änderung"}),e.jsx("span",{children:new Date(s.last_price_change).toLocaleDateString("de-DE")})]})]})]},s.manufacturer))}),o&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h2",{className:"text-lg font-bold flex items-center gap-2",children:[o,e.jsxs(m,{variant:"secondary",className:"text-xs",children:[u.length," Angebote"]})]}),e.jsx("div",{className:"border rounded-lg overflow-hidden",children:e.jsxs(z,{children:[e.jsx(P,{children:e.jsxs(h,{className:"bg-muted/40",children:[e.jsx(a,{className:"text-[11px] font-semibold uppercase",children:"SKU"}),e.jsx(a,{className:"text-[11px] font-semibold uppercase",children:"Produkt"}),e.jsx(a,{className:"text-[11px] font-semibold uppercase text-right",children:"Preis"}),e.jsx(a,{className:"text-[11px] font-semibold uppercase text-right",children:"Vorheriger Preis"}),e.jsx(a,{className:"text-[11px] font-semibold uppercase text-center",children:"Lager"}),e.jsx(a,{className:"text-[11px] font-semibold uppercase",children:"Seit"})]})}),e.jsx(M,{children:u.map(s=>e.jsxs(h,{children:[e.jsx(i,{className:"text-xs font-mono",children:s.sku||"—"}),e.jsx(i,{className:"text-xs max-w-[250px] truncate",children:s.title||"—"}),e.jsxs(i,{className:"text-xs text-right font-medium",children:[n(s.price),s.previous_price&&s.price&&s.price<s.previous_price&&e.jsx(E,{size:12,className:"inline ml-1 text-emerald-500"}),s.previous_price&&s.price&&s.price>s.previous_price&&e.jsx(B,{size:12,className:"inline ml-1 text-red-500"})]}),e.jsx(i,{className:"text-xs text-right text-muted-foreground",children:n(s.previous_price)}),e.jsx(i,{className:"text-center",children:s.available_qty!=null?e.jsx(m,{variant:"outline",className:`text-[10px] ${s.available_qty>=100?"bg-emerald-500/10 text-emerald-700":s.available_qty>=20?"bg-amber-500/10 text-amber-700":"bg-red-500/10 text-red-700"}`,children:s.available_qty}):"—"}),e.jsx(i,{className:"text-xs text-muted-foreground",children:new Date(s.first_seen_at).toLocaleDateString("de-DE")})]},s.id))})]})})]})]})]})}export{J 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.