feat: Leads-Karten sind reine Info-Anzeige (Status/Notiz-Editing entfernt)
Leads-Tab zeigt/verfolgt nur noch die Automatisierung; Status & Doku laufen im Akquise-Ticket (WOID-Chip). Alte Notizen bleiben read-only sichtbar. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -119,7 +119,7 @@ function CycleBar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function LeadsPage() {
|
export default function LeadsPage() {
|
||||||
const { leads, pipelines, loading, error, updateLead } = useLeads()
|
const { leads, pipelines, loading, error } = useLeads()
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
const [status, setStatus] = useState('all')
|
const [status, setStatus] = useState('all')
|
||||||
const [showSettings, setShowSettings] = useState(false)
|
const [showSettings, setShowSettings] = useState(false)
|
||||||
@@ -150,7 +150,7 @@ export default function LeadsPage() {
|
|||||||
<style>{pulseStyle}</style>
|
<style>{pulseStyle}</style>
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title="Leads"
|
title="Leads"
|
||||||
subtitle="Recherche-Ergebnisse der täglichen 06:00-Routine — neue Leads werden automatisch verarbeitet"
|
subtitle="Recherche-Ergebnisse der täglichen 06:00-Routine — hier nur Anzeige & Verfolgung, gearbeitet wird im Akquise-Ticket"
|
||||||
actions={
|
actions={
|
||||||
<Button variant={showSettings ? 'primary' : 'default'} onClick={() => setShowSettings((s) => !s)}>
|
<Button variant={showSettings ? 'primary' : 'default'} onClick={() => setShowSettings((s) => !s)}>
|
||||||
<FaGear /> Sucheinstellungen
|
<FaGear /> Sucheinstellungen
|
||||||
@@ -211,7 +211,7 @@ export default function LeadsPage() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{filtered.map((lead) => (
|
{filtered.map((lead) => (
|
||||||
<LeadCard key={lead.$id} lead={lead} pipeline={pipelines[lead.leadId]} onUpdate={updateLead} />
|
<LeadCard key={lead.$id} lead={lead} pipeline={pipelines[lead.leadId]} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -338,24 +338,13 @@ function EmailDraft({ pipeline }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function LeadCard({ lead, pipeline, onUpdate }) {
|
/** Reine Info-Anzeige — Status/Notizen werden NICHT hier gepflegt,
|
||||||
|
* sondern im Akquise-Ticket des Leads (WOID-Chip). */
|
||||||
|
function LeadCard({ lead, pipeline }) {
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
const [notiz, setNotiz] = useState(lead.notiz || '')
|
|
||||||
const [busy, setBusy] = useState(false)
|
|
||||||
const meta = statusMeta(lead.crmStatus || 'neu')
|
const meta = statusMeta(lead.crmStatus || 'neu')
|
||||||
const score = lead.leadScore || 0
|
const score = lead.leadScore || 0
|
||||||
|
|
||||||
const setStatus = async (e) => {
|
|
||||||
setBusy(true)
|
|
||||||
await onUpdate(lead.$id, { crmStatus: e.target.value })
|
|
||||||
setBusy(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
const saveNotiz = async () => {
|
|
||||||
if (notiz === (lead.notiz || '')) return
|
|
||||||
await onUpdate(lead.$id, { notiz })
|
|
||||||
}
|
|
||||||
|
|
||||||
const websiteUrl = /^https?:\/\//.test(lead.website || '') ? lead.website : null
|
const websiteUrl = /^https?:\/\//.test(lead.website || '') ? lead.website : null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -446,18 +435,7 @@ function LeadCard({ lead, pipeline, onUpdate }) {
|
|||||||
<FaHashtag />{lead.woid}
|
<FaHashtag />{lead.woid}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<select
|
<Button size="sm" variant="ghost" onClick={() => setOpen((o) => !o)} title={open ? 'Weniger' : 'Details'} style={{ marginLeft: 'auto' }}>
|
||||||
className="form-control"
|
|
||||||
value={lead.crmStatus || 'neu'}
|
|
||||||
onChange={setStatus}
|
|
||||||
disabled={busy}
|
|
||||||
style={{ width: 'auto', marginLeft: 'auto', padding: '4px 8px', fontSize: 13 }}
|
|
||||||
>
|
|
||||||
{STATUS_OPTIONS.map((s) => (
|
|
||||||
<option key={s.id} value={s.id}>{s.label}</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<Button size="sm" variant="ghost" onClick={() => setOpen((o) => !o)} title={open ? 'Weniger' : 'Details'}>
|
|
||||||
{open ? <FaChevronUp /> : <FaChevronDown />}
|
{open ? <FaChevronUp /> : <FaChevronDown />}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -482,16 +460,7 @@ function LeadCard({ lead, pipeline, onUpdate }) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<EmailDraft pipeline={pipeline} />
|
<EmailDraft pipeline={pipeline} />
|
||||||
<Field label="Notiz">
|
{lead.notiz && <div><strong>Notiz (Alt-Bestand):</strong> {lead.notiz}</div>}
|
||||||
<textarea
|
|
||||||
className="form-control"
|
|
||||||
rows={2}
|
|
||||||
value={notiz}
|
|
||||||
onChange={(e) => setNotiz(e.target.value)}
|
|
||||||
onBlur={saveNotiz}
|
|
||||||
placeholder="Interne Notiz zum Lead..."
|
|
||||||
/>
|
|
||||||
</Field>
|
|
||||||
<div className="faint" style={{ fontSize: 11 }}>
|
<div className="faint" style={{ fontSize: 11 }}>
|
||||||
Aufgenommen: {lead.addedAt ? new Date(lead.addedAt).toLocaleDateString('de-DE') : '-'}
|
Aufgenommen: {lead.addedAt ? new Date(lead.addedAt).toLocaleDateString('de-DE') : '-'}
|
||||||
{lead.leadId ? ` · ${lead.leadId}` : ''}
|
{lead.leadId ? ` · ${lead.leadId}` : ''}
|
||||||
|
|||||||
Reference in New Issue
Block a user