Leads ohne eingefrorene Status (Paket E)
Die Status-Reiter, die Zahlen "Neu"/"Gewonnen" und das Status-Abzeichen lasen crmStatus, das seit dem 16.07. niemand mehr pflegt (gearbeitet wird im Akquise-Ticket). Suche, Sucheinstellungen, Pipeline und Lead-Karten bleiben. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5a066eb3c4
commit
92fdfdc961
1 file changed
+2
-28
+2
-28
@@ -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() {
|
||||
|
||||
<div className="kpi-grid" style={{ marginBottom: 16 }}>
|
||||
<Kpi label="Leads gesamt" value={kpis.total} />
|
||||
<Kpi label="Neu" value={kpis.neu} accent="#3b82f6" />
|
||||
<Kpi label="Gewonnen" value={kpis.gewonnen} accent="#10b981" />
|
||||
<Kpi label="Ø Lead-Score" value={kpis.avg} accent="#f59e0b" />
|
||||
<Kpi label="Orte" value={kpis.orte} accent="#8b5cf6" />
|
||||
</div>
|
||||
|
||||
<Card pad={false}>
|
||||
<div className="ui-card-head" style={{ gap: 12, flexWrap: 'wrap' }}>
|
||||
<div className="seg">
|
||||
<button className={status === 'all' ? 'active' : ''} onClick={() => setStatus('all')}>Alle</button>
|
||||
{STATUS_OPTIONS.map((s) => (
|
||||
<button key={s.id} className={status === s.id ? 'active' : ''} onClick={() => setStatus(s.id)}>
|
||||
{s.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<input
|
||||
className="form-control search-input"
|
||||
placeholder="Lead suchen..."
|
||||
@@ -342,7 +318,6 @@ function EmailDraft({ pipeline }) {
|
||||
* sondern im Akquise-Ticket des Leads (WOID-Chip). */
|
||||
function LeadCard({ lead, pipeline }) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const meta = statusMeta(lead.crmStatus || 'neu')
|
||||
const score = lead.leadScore || 0
|
||||
|
||||
const websiteUrl = /^https?:\/\//.test(lead.website || '') ? lead.website : null
|
||||
@@ -372,7 +347,6 @@ function LeadCard({ lead, pipeline }) {
|
||||
<PipelineBar lead={lead} />
|
||||
|
||||
<div className="flex gap-2 wrap" style={{ alignItems: 'center' }}>
|
||||
<Badge tone={meta.tone} dot>{meta.label}</Badge>
|
||||
{lead.googleNote && (
|
||||
<Badge tone="warn">
|
||||
<FaStar /> {lead.googleNote} ({lead.anzahlBewertungen || 0})
|
||||
|
||||
Reference in new issue
Block a user