Includes all work to date: - local_backend: FastAPI backend with products, orders, tables, shifts, cloud sync - manager_dashboard: React manager UI with product/category management, reports, settings - waiter_pwa: React PWA for waiter devices - Category reparent endpoint and UI - Waiter domain: local_ip sent on heartbeat, waiter_domain persisted from cloud response - QR code modal in AppInfoTab for waiter domain - Product form: number input spinners removed, category pre-selected on new product - Category row: count badge moved to far right Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
import { STATUS_STYLES } from './tokens'
|
|
|
|
// Unified StatusBadge — replaces both src/components/StatusBadge.jsx
|
|
// and the StatusBadge in TablePrimitives.jsx.
|
|
//
|
|
// Greek labels map to the canonical status keys used across the app.
|
|
const LABELS = {
|
|
free: 'Ελεύθερο',
|
|
open: 'Ανοιχτό',
|
|
active: 'Ενεργό',
|
|
partially_paid: 'Μερική πληρωμή',
|
|
paid: 'Πληρώθηκε',
|
|
closed: 'Κλειστό',
|
|
'force-closed': 'Αναγκαστικό κλείσιμο',
|
|
cancelled: 'Ακυρώθηκε',
|
|
completed: 'Ολοκληρώθηκε',
|
|
failed: 'Απέτυχε',
|
|
success: 'Επιτυχία',
|
|
}
|
|
|
|
export default function Badge({ status, pulse = false }) {
|
|
const s = STATUS_STYLES[status] || STATUS_STYLES.closed
|
|
const label = LABELS[status] ?? (status ? status.replace(/[_-]/g, ' ') : 'άγνωστο')
|
|
|
|
return (
|
|
<span className={`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-mono uppercase tracking-[0.08em] ring-1 ring-inset ${s.bg} ${s.text} ${s.ring}`}>
|
|
<span className={`relative inline-block h-1.5 w-1.5 rounded-full flex-shrink-0 ${s.dot}`}>
|
|
{pulse && (status === 'active' || status === 'open') && (
|
|
<span className={`absolute inset-0 rounded-full ${s.dot} animate-ping opacity-75`} />
|
|
)}
|
|
</span>
|
|
{label}
|
|
</span>
|
|
)
|
|
}
|