diff --git a/src/components/AnalyseRow.jsx b/src/components/AnalyseRow.jsx index 9736f91..b162ff9 100644 --- a/src/components/AnalyseRow.jsx +++ b/src/components/AnalyseRow.jsx @@ -1,8 +1,8 @@ import { useState, useEffect } from 'react' import { fetchAnalyse, setAnalyse } from '../lib/analyseApi' import { analyseStatus, textformLabel, canSubmitTextform, channelLabel, legalLinks, chatTemplate, privacyHint } from '../lib/analyseView' - -const COLORS = { green: 'var(--green-fg)', red: 'var(--red-fg)', grey: 'var(--text-2)' } +import { Badge, Button, Dialog, Field } from './ui' +import { analyseColorTone } from './projectTones' // Kompakte Zeile "Website-Analyse" je Projekt (lädt beim Einbinden; mit key=Projekt-ID verwenden) export default function AnalyseRow({ projectId }) { @@ -54,80 +54,87 @@ export default function AnalyseRow({ projectId }) { } catch { /* Kopieren nicht möglich: Text bleibt markierbar */ } } const status = analyseStatus(data) + const label = data ? textformLabel(data.avvVersion) : null + const links = data ? legalLinks(data.avvVersion) : null + const dateId = `analyse-datum-${projectId}` + const errorLine = error ?

{error}

: null return ( -
-
- Website-Analyse: - {loadError ? ( - {loadError} - ) : data ? ( - {status.text} - ) : ( - Lädt … - )} - {status.hint && ({status.hint})} - {status.canEnable && !mode && ( - - )} - {status.canDisable && !mode && ( - + <> +
+
+ Website-Analyse: + {loadError ? ( + {loadError} + ) : data ? ( + {status.text} + ) : ( + Lädt … + )} + {status.hint && ({status.hint})} + {status.canEnable && mode !== 'off' && ( + + )} + {status.canDisable && !mode && ( + + )} +
+ + {mode === 'off' && ( +
+ Website-Analyse wirklich ausschalten? + + +
)} + + {mode !== 'on' && errorLine}
- {mode === 'on' && data && (() => { - const label = textformLabel(data.avvVersion) - const links = legalLinks(data.avvVersion) - return ( -
- -
-
- ) - })()} - - {mode === 'off' && ( -
- Website-Analyse wirklich ausschalten? - - -
+ {privacyBlocked &&

{privacyHint(data.privacy)}

} +
+ Textvorlage für den Chat +

{chatTemplate(data.avvVersion)}

+ +
+ )} - - {error &&
{error}
} -
+ ) } diff --git a/src/styles/global.css b/src/styles/global.css index fdfaa87..e2109d9 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -1143,6 +1143,10 @@ button.link { text-align: left; } /* Reset und Gewicht von button.link stehen im /* ---------- Dialog-Inhalte ---------- */ .dialog-form { display: flex; flex-direction: column; gap: 16px; } +/* Textvorlage der Analyse-Zustimmung (details im Dialog): Zeiger wie vorher, Abstaende statt Aussenabstaende im JSX, die Vorlage enthaelt lange Adressen ohne Leerzeichen */ +.dialog-body details > summary { cursor: pointer; } +.dialog-body details[open] > summary { margin-bottom: 8px; } +.dialog-body details > .prose { margin-bottom: 8px; overflow-wrap: anywhere; } /* ---------- Preview-Block (im Projekt-Dialog, am Ticket und beim Kunden) ---------- */ .pv-block { font-size: 13px; display: flex; flex-direction: column; gap: 10px; }