Files
myeasycms-v2/apps/web/lib/status-badges.ts
T. Zehetbauer c6d564836f
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 17m4s
Workflow / ⚫️ Test (push) Has been skipped
fix: add missing newlines at the end of JSON files; clean up formatting in page components
2026-04-02 11:02:58 +02:00

236 lines
6.6 KiB
TypeScript

export const MEMBER_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
active: 'default',
inactive: 'secondary',
pending: 'outline',
resigned: 'destructive',
excluded: 'destructive',
};
export const MEMBER_STATUS_LABEL_KEYS: Record<string, string> = {
active: 'status.active',
inactive: 'status.inactive',
pending: 'status.pending',
resigned: 'status.resigned',
excluded: 'status.excluded',
};
export const INVOICE_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
draft: 'outline',
sent: 'secondary',
paid: 'default',
overdue: 'destructive',
cancelled: 'destructive',
};
export const INVOICE_STATUS_LABEL_KEYS: Record<string, string> = {
draft: 'status.draft',
sent: 'status.sent',
paid: 'status.paid',
overdue: 'status.overdue',
cancelled: 'status.cancelled',
};
export const BATCH_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
draft: 'outline',
submitted: 'secondary',
processing: 'secondary',
completed: 'default',
failed: 'destructive',
};
export const BATCH_STATUS_LABEL_KEYS: Record<string, string> = {
draft: 'status.draft',
submitted: 'status.submitted',
processing: 'status.processing',
completed: 'status.completed',
failed: 'status.failed',
};
export const NEWSLETTER_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
draft: 'outline',
scheduled: 'secondary',
sending: 'secondary',
sent: 'default',
failed: 'destructive',
};
export const NEWSLETTER_STATUS_LABEL_KEYS: Record<string, string> = {
draft: 'status.draft',
scheduled: 'status.scheduled',
sending: 'status.sending',
sent: 'status.sent',
failed: 'status.failed',
};
export const EVENT_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
planned: 'outline',
open: 'secondary',
full: 'secondary',
running: 'default',
completed: 'default',
cancelled: 'destructive',
registration_open: 'default',
};
export const EVENT_STATUS_LABEL_KEYS: Record<string, string> = {
planned: 'status.planned',
open: 'status.open',
full: 'status.full',
running: 'status.running',
completed: 'status.completed',
cancelled: 'status.cancelled',
registration_open: 'status.registration_open',
};
export const COURSE_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
planned: 'outline',
open: 'default',
active: 'default',
running: 'secondary',
completed: 'secondary',
cancelled: 'destructive',
};
export const COURSE_STATUS_LABEL_KEYS: Record<string, string> = {
planned: 'status.planned',
open: 'status.open',
active: 'status.active',
running: 'status.running',
completed: 'status.completed',
cancelled: 'status.cancelled',
};
export const APPLICATION_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
submitted: 'outline',
review: 'secondary',
approved: 'default',
rejected: 'destructive',
};
export const APPLICATION_STATUS_LABEL_KEYS: Record<string, string> = {
submitted: 'status.submitted',
review: 'status.review',
approved: 'status.approved',
rejected: 'status.rejected',
};
export const NEWSLETTER_RECIPIENT_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
pending: 'secondary',
sent: 'default',
failed: 'destructive',
bounced: 'destructive',
};
export const NEWSLETTER_RECIPIENT_STATUS_LABEL_KEYS: Record<string, string> = {
pending: 'status.pending',
sent: 'status.sent',
failed: 'status.failed',
bounced: 'status.bounced',
};
export const BOOKING_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline' | 'info'
> = {
pending: 'secondary',
confirmed: 'default',
checked_in: 'info',
checked_out: 'outline',
cancelled: 'destructive',
no_show: 'destructive',
};
export const BOOKING_STATUS_LABEL_KEYS: Record<string, string> = {
pending: 'status.pending',
confirmed: 'status.confirmed',
checked_in: 'status.checked_in',
checked_out: 'status.checked_out',
cancelled: 'status.cancelled',
no_show: 'status.no_show',
};
export const MODULE_STATUS_VARIANT: Record<
string,
'default' | 'secondary' | 'destructive' | 'outline'
> = {
published: 'default',
draft: 'outline',
archived: 'secondary',
};
export const MODULE_STATUS_LABEL_KEYS: Record<string, string> = {
published: 'status.published',
draft: 'status.draft',
archived: 'status.archived',
};
export const SITE_PAGE_STATUS_LABEL_KEYS: Record<string, string> = {
published: 'status.published',
draft: 'status.draft',
};
export const SITE_POST_STATUS_VARIANT: Record<string, 'default' | 'secondary'> =
{
published: 'default',
draft: 'secondary',
};
export const SITE_POST_STATUS_LABEL_KEYS: Record<string, string> = {
published: 'status.published',
draft: 'status.draft',
};
// ---------------------------------------------------------------------------
// Legacy named exports kept for backward-compat during incremental migration.
// These are DEPRECATED — prefer the *_LABEL_KEYS variants + t() in consumers.
// ---------------------------------------------------------------------------
/** @deprecated Use MEMBER_STATUS_LABEL_KEYS + t() */
export const MEMBER_STATUS_LABEL = MEMBER_STATUS_LABEL_KEYS;
/** @deprecated Use INVOICE_STATUS_LABEL_KEYS + t() */
export const INVOICE_STATUS_LABEL = INVOICE_STATUS_LABEL_KEYS;
/** @deprecated Use BATCH_STATUS_LABEL_KEYS + t() */
export const BATCH_STATUS_LABEL = BATCH_STATUS_LABEL_KEYS;
/** @deprecated Use NEWSLETTER_STATUS_LABEL_KEYS + t() */
export const NEWSLETTER_STATUS_LABEL = NEWSLETTER_STATUS_LABEL_KEYS;
/** @deprecated Use EVENT_STATUS_LABEL_KEYS + t() */
export const EVENT_STATUS_LABEL = EVENT_STATUS_LABEL_KEYS;
/** @deprecated Use COURSE_STATUS_LABEL_KEYS + t() */
export const COURSE_STATUS_LABEL = COURSE_STATUS_LABEL_KEYS;
/** @deprecated Use APPLICATION_STATUS_LABEL_KEYS + t() */
export const APPLICATION_STATUS_LABEL = APPLICATION_STATUS_LABEL_KEYS;
/** @deprecated Use NEWSLETTER_RECIPIENT_STATUS_LABEL_KEYS + t() */
export const NEWSLETTER_RECIPIENT_STATUS_LABEL =
NEWSLETTER_RECIPIENT_STATUS_LABEL_KEYS;
/** @deprecated Use BOOKING_STATUS_LABEL_KEYS + t() */
export const BOOKING_STATUS_LABEL = BOOKING_STATUS_LABEL_KEYS;
/** @deprecated Use MODULE_STATUS_LABEL_KEYS + t() */
export const MODULE_STATUS_LABEL = MODULE_STATUS_LABEL_KEYS;
/** @deprecated Use SITE_PAGE_STATUS_LABEL_KEYS + t() */
export const SITE_PAGE_STATUS_LABEL = SITE_PAGE_STATUS_LABEL_KEYS;
/** @deprecated Use SITE_POST_STATUS_LABEL_KEYS + t() */
export const SITE_POST_STATUS_LABEL = SITE_POST_STATUS_LABEL_KEYS;