import { useQuery } from '@tanstack/react-query' import AppShell from '../components/AppShell' import client from '../api/client' import { getVenueSettings } from '../api/venueSettings' // ── helpers ─────────────────────────────────────────────────────────────────── function fmtTime(iso) { if (!iso) return '—' return new Date(iso).toLocaleTimeString('el-GR', { hour: '2-digit', minute: '2-digit' }) } 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 `${m}λ` if (m === 0) return `${h}ω` return `${h}ω ${m}λ` } function fmtEuro(n) { return '€' + parseFloat(n || 0).toFixed(2) } 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 (