EXPORT-1: Datenexport-Karte auf /einstellungen (Anker-Download, deutsche Erklaertexte + Foto-Hinweis)

This commit is contained in:
2026-06-06 07:55:14 +02:00
parent f86a044143
commit 8fa02a5d49
3 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
/**
* EXPORT-1: Datenexport-Karte (auf /einstellungen) — lädt GET /export als Zip.
* Schlichter Anker-Download (kein fetch/Blob nötig); der Server setzt
* Content-Disposition mit Datumsdateinamen.
*/
import { API_BASE_URL } from '../api/client'
import { de } from '../strings/de'
export default function DatenexportCard() {
const t = de.pages.datenexport
return (
<section>
<h3>{t.title}</h3>
<p className="muted">{t.intro}</p>
<p className="muted">{t.photoNote}</p>
<a className="btn btn--primary" href={`${API_BASE_URL}/export`} download>
{t.button}
</a>
</section>
)
}

View File

@@ -13,6 +13,8 @@ import {
type BreederProfile, type BreederProfile,
} from '../api/settings' } from '../api/settings'
import { useApi, useMutation } from '../hooks/useApi' import { useApi, useMutation } from '../hooks/useApi'
// EXPORT-1 (Oscar): Datenexport-Karte
import DatenexportCard from '../components/DatenexportCard'
export default function EinstellungenPage() { export default function EinstellungenPage() {
const t = de.pages.einstellungen const t = de.pages.einstellungen
@@ -95,6 +97,8 @@ export default function EinstellungenPage() {
{saved && <span className="muted">{tz.saved}</span>} {saved && <span className="muted">{tz.saved}</span>}
</div> </div>
</form> </form>
<DatenexportCard />
</section> </section>
) )
} }

View File

@@ -563,6 +563,15 @@ export const de = {
}, },
}, },
}, },
// ── EXPORT-1 (Oscar): Datenexport (Karte auf /einstellungen) ──
datenexport: {
title: 'Datenexport',
intro:
'Sicherung deiner Daten — alle Tiere, Würfe und Kontakte als Tabellen (CSV für Excel) plus eine vollständige Datensicherung (JSON), gebündelt als Zip.',
button: 'Export herunterladen',
photoNote:
'Fotos sind nicht enthalten — sie liegen als Bilddateien im Datenordner der Anwendung und können von dort gesichert werden.',
},
}, },
api: { api: {
errors: { errors: {