update ui changes
This commit is contained in:
25
src/features/lyts/utils/rewardStatus.ts
Normal file
25
src/features/lyts/utils/rewardStatus.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type {RewardStatus} from '@/features/lyts/types/reward';
|
||||
|
||||
/**
|
||||
* Reward status → badge treatment.
|
||||
*
|
||||
* Only `expiring` and `expired` carry colour. An active reward is the normal
|
||||
* case and a paused one is a deliberate choice by the merchant — neither
|
||||
* needs attention. Colouring all four would leave nothing standing out on a
|
||||
* page whose entire job is surfacing the ones about to lapse.
|
||||
*/
|
||||
export const REWARD_STATUS: Record<
|
||||
RewardStatus,
|
||||
{label: string; variant: 'neutral' | 'warning' | 'error'}
|
||||
> = {
|
||||
active: {label: 'Active', variant: 'neutral'},
|
||||
paused: {label: 'Paused', variant: 'neutral'},
|
||||
expiring: {label: 'Expiring', variant: 'warning'},
|
||||
expired: {label: 'Expired', variant: 'error'},
|
||||
};
|
||||
|
||||
/*
|
||||
* daysUntil / usageRate used to live here. They are calculations about
|
||||
* rewards, not about badges, so they moved to services/lytsService — this
|
||||
* module is the presentation mapping and nothing else.
|
||||
*/
|
||||
Reference in New Issue
Block a user