Stundenkonto und Vorschuss am Einrichtungs-Ticket und beim Kunden
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f0d39f2eee
commit
dce7c3e53a
7 files changed
+154
-2
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { Stat } from '../ui'
|
||||
import { useStundenkonto } from '../../hooks/useStundenkonto'
|
||||
import { stundenkontoAnsicht } from '../../lib/stundenkontoView'
|
||||
|
||||
// Stundenkonto eines Kunden als Kennzahlen: Guthaben, Vorschuss für die Einrichtung, Mehraufwand, nächster Verfall.
|
||||
// Hosting-Abo und fehlendes Abo bekommen nur den Hinweis. Ohne brauchbare Antwort (Fehler, altes Portal) steht nichts da.
|
||||
export default function StundenkontoLeiste({ customerId, reloadKey = '' }) {
|
||||
const { antwort, loading } = useStundenkonto(customerId, { reloadKey })
|
||||
if (loading) return <p className="muted">Wird geladen …</p>
|
||||
const ansicht = stundenkontoAnsicht(antwort)
|
||||
if (!ansicht) return null
|
||||
if (ansicht.art !== 'konto') return <p className="muted">{ansicht.hinweis}</p>
|
||||
return (
|
||||
<div className="stats">
|
||||
{ansicht.eintraege.map((e) => <Stat key={e.key} label={e.label} value={e.wert} sub={e.sub} tone={e.ton} />)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user