import { useQuery } from '@tanstack/react-query' import AppShell from '../components/AppShell' import client from '../api/client' import { useFormat, useTranslation } from '@xenia/i18n' import { money as fmtEuro, tw } from '../i18n' import { getVenueSettings } from '../api/venueSettings' // ── helpers ─────────────────────────────────────────────────────────────────── function fmtDuration(seconds) { if (seconds == null || seconds < 0) return '—' const h = Math.floor(seconds / 3600) const m = Math.floor((seconds % 3600) / 60) if (h === 0) return tw('common.minutesShort', { m }) if (m === 0) return tw('common.hoursShort', { h }) return tw('common.hoursMinutesShort', { h, m }) } function sinceSeconds(isoStart) { if (!isoStart) return 0 return Math.floor((Date.now() - new Date(isoStart).getTime()) / 1000) } function breakDurationSeconds(b) { if (!b.started_at) return 0 const end = b.ended_at ? new Date(b.ended_at) : new Date() return Math.floor((end - new Date(b.started_at)) / 1000) } // ── stat card ───────────────────────────────────────────────────────────────── function StatCard({ label, value, sub, accent }) { return (