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() {
|
||||
const { leads, pipelines, loading, error, updateLead } = useLeads()
|
||||
const { leads, pipelines, loading, error } = useLeads()
|
||||
const [search, setSearch] = useState('')
|
||||
const [status, setStatus] = useState('all')
|
||||
const [showSettings, setShowSettings] = useState(false)
|
||||
@@ -150,7 +150,7 @@ export default function LeadsPage() {
|
||||
<style>{pulseStyle}</style>
|
||||
<PageHeader
|
||||
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={
|
||||
<Button variant={showSettings ? 'primary' : 'default'} onClick={() => setShowSettings((s) => !s)}>
|
||||
<FaGear /> Sucheinstellungen
|
||||
@@ -211,7 +211,7 @@ export default function LeadsPage() {
|
||||
}}
|
||||
>
|
||||
{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>
|
||||
)}
|
||||
@@ -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 [notiz, setNotiz] = useState(lead.notiz || '')
|
||||
const [busy, setBusy] = useState(false)
|
||||
const meta = statusMeta(lead.crmStatus || 'neu')
|
||||
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
|
||||
|
||||
return (
|
||||
@@ -446,18 +435,7 @@ function LeadCard({ lead, pipeline, onUpdate }) {
|
||||
<FaHashtag />{lead.woid}
|
||||
</Button>
|
||||
)}
|
||||
<select
|
||||
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'}>
|
||||
<Button size="sm" variant="ghost" onClick={() => setOpen((o) => !o)} title={open ? 'Weniger' : 'Details'} style={{ marginLeft: 'auto' }}>
|
||||
{open ? <FaChevronUp /> : <FaChevronDown />}
|
||||
</Button>
|
||||
</div>
|
||||
@@ -482,16 +460,7 @@ function LeadCard({ lead, pipeline, onUpdate }) {
|
||||
</div>
|
||||
)}
|
||||
<EmailDraft pipeline={pipeline} />
|
||||
<Field label="Notiz">
|
||||
<textarea
|
||||
className="form-control"
|
||||
rows={2}
|
||||
value={notiz}
|
||||
onChange={(e) => setNotiz(e.target.value)}
|
||||
onBlur={saveNotiz}
|
||||
placeholder="Interne Notiz zum Lead..."
|
||||
/>
|
||||
</Field>
|
||||
{lead.notiz && <div><strong>Notiz (Alt-Bestand):</strong> {lead.notiz}</div>}
|
||||
<div className="faint" style={{ fontSize: 11 }}>
|
||||
Aufgenommen: {lead.addedAt ? new Date(lead.addedAt).toLocaleDateString('de-DE') : '-'}
|
||||
{lead.leadId ? ` · ${lead.leadId}` : ''}
|
||||
|
||||
Reference in New Issue
Block a user