do to formatters
This commit is contained in:
38
apps/website/lib/formatters/OnboardingStatusFormatter.ts
Normal file
38
apps/website/lib/formatters/OnboardingStatusFormatter.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* OnboardingStatusDisplay
|
||||
*
|
||||
* Deterministic mapping of onboarding status to display labels and variants.
|
||||
*/
|
||||
|
||||
export class OnboardingStatusFormatter {
|
||||
/**
|
||||
* Maps onboarding success status to display label.
|
||||
*/
|
||||
static statusLabel(success: boolean): string {
|
||||
return success ? 'Onboarding Complete' : 'Onboarding Failed';
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps onboarding success status to badge variant.
|
||||
*/
|
||||
static statusVariant(success: boolean): string {
|
||||
return success ? 'performance-green' : 'racing-red';
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps onboarding success status to icon.
|
||||
*/
|
||||
static statusIcon(success: boolean): string {
|
||||
return success ? '✅' : '❌';
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps onboarding success status to message.
|
||||
*/
|
||||
static statusMessage(success: boolean, errorMessage?: string): string {
|
||||
if (success) {
|
||||
return 'Your onboarding has been completed successfully.';
|
||||
}
|
||||
return errorMessage || 'Failed to complete onboarding. Please try again.';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user