diff --git a/src/pages/LeadsPage.jsx b/src/pages/LeadsPage.jsx index fdfd682..83d6f01 100644 --- a/src/pages/LeadsPage.jsx +++ b/src/pages/LeadsPage.jsx @@ -38,16 +38,6 @@ const pulseStyle = ` @keyframes leadPulse { 0% { opacity: .35 } 50% { opacity: 1 } 100% { opacity: .35 } } ` -const STATUS_OPTIONS = [ - { id: 'neu', label: 'Neu', tone: 'info' }, - { id: 'kontaktiert', label: 'Kontaktiert', tone: 'warn' }, - { id: 'interessiert', label: 'Interessiert', tone: 'warn' }, - { id: 'gewonnen', label: 'Gewonnen', tone: 'ok' }, - { id: 'abgelehnt', label: 'Abgelehnt', tone: 'danger' }, -] - -const statusMeta = (id) => STATUS_OPTIONS.find((s) => s.id === id) || STATUS_OPTIONS[0] - function scoreColor(score) { if (score >= 85) return '#34d399' if (score >= 70) return '#fbbf24' @@ -121,28 +111,24 @@ function CycleBar() { export default function LeadsPage() { const { leads, pipelines, loading, error } = useLeads() const [search, setSearch] = useState('') - const [status, setStatus] = useState('all') const [showSettings, setShowSettings] = useState(false) const filtered = useMemo(() => { return (leads || []) - .filter((l) => (status === 'all' ? true : (l.crmStatus || 'neu') === status)) .filter((l) => { if (!search) return true const s = search.toLowerCase() return `${l.firma} ${l.ort || ''} ${l.email || ''} ${l.branche || ''}`.toLowerCase().includes(s) }) - }, [leads, search, status]) + }, [leads, search]) const kpis = useMemo(() => { const all = leads || [] - const neu = all.filter((l) => (l.crmStatus || 'neu') === 'neu').length - const gewonnen = all.filter((l) => l.crmStatus === 'gewonnen').length const avg = all.length ? Math.round(all.reduce((sum, l) => sum + (l.leadScore || 0), 0) / all.length) : 0 const orte = new Set(all.map((l) => (l.ort || '').trim().toLowerCase()).filter(Boolean)) - return { total: all.length, neu, gewonnen, avg, orte: orte.size } + return { total: all.length, avg, orte: orte.size } }, [leads]) return ( @@ -168,22 +154,12 @@ export default function LeadsPage() {