mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 15:31:13 -05:00
feat: Implement Phase 3 optimizations
This commit is contained in:
@@ -28,6 +28,94 @@ export const MODERATION_CONSTANTS = {
|
||||
|
||||
// Filter debounce
|
||||
FILTER_DEBOUNCE_MS: 300,
|
||||
|
||||
// Role Labels
|
||||
ROLE_LABELS: {
|
||||
admin: 'Administrator',
|
||||
moderator: 'Moderator',
|
||||
user: 'User',
|
||||
superuser: 'Superuser',
|
||||
} as const,
|
||||
|
||||
// Status Labels
|
||||
STATUS_LABELS: {
|
||||
pending: 'Pending Review',
|
||||
approved: 'Approved',
|
||||
rejected: 'Rejected',
|
||||
partially_approved: 'Partially Approved',
|
||||
escalated: 'Escalated',
|
||||
in_review: 'In Review',
|
||||
} as const,
|
||||
|
||||
// Submission Type Labels
|
||||
SUBMISSION_TYPE_LABELS: {
|
||||
park: 'Park',
|
||||
ride: 'Ride',
|
||||
company: 'Company',
|
||||
ride_model: 'Ride Model',
|
||||
photo: 'Photo',
|
||||
} as const,
|
||||
|
||||
// Report Type Labels
|
||||
REPORT_TYPE_LABELS: {
|
||||
spam: 'Spam',
|
||||
inappropriate: 'Inappropriate Content',
|
||||
harassment: 'Harassment',
|
||||
misinformation: 'Misinformation',
|
||||
fake_info: 'Fake Information',
|
||||
offensive: 'Offensive Language',
|
||||
other: 'Other',
|
||||
} as const,
|
||||
|
||||
// Entity Type Labels
|
||||
ENTITY_TYPE_LABELS: {
|
||||
park: 'Park',
|
||||
ride: 'Ride',
|
||||
company: 'Company',
|
||||
ride_model: 'Ride Model',
|
||||
review: 'Review',
|
||||
profile: 'Profile',
|
||||
content_submission: 'Content Submission',
|
||||
} as const,
|
||||
|
||||
// Status Colors (for badges)
|
||||
STATUS_COLORS: {
|
||||
pending: 'secondary',
|
||||
approved: 'default',
|
||||
rejected: 'destructive',
|
||||
partially_approved: 'outline',
|
||||
escalated: 'destructive',
|
||||
in_review: 'secondary',
|
||||
} as const,
|
||||
|
||||
// Report Status Colors
|
||||
REPORT_STATUS_COLORS: {
|
||||
pending: 'secondary',
|
||||
reviewed: 'default',
|
||||
dismissed: 'outline',
|
||||
resolved: 'default',
|
||||
} as const,
|
||||
} as const;
|
||||
|
||||
export type ModerationConstants = typeof MODERATION_CONSTANTS;
|
||||
|
||||
// Helper functions for type-safe label access
|
||||
export function getRoleLabel(role: keyof typeof MODERATION_CONSTANTS.ROLE_LABELS): string {
|
||||
return MODERATION_CONSTANTS.ROLE_LABELS[role] || role;
|
||||
}
|
||||
|
||||
export function getStatusLabel(status: keyof typeof MODERATION_CONSTANTS.STATUS_LABELS): string {
|
||||
return MODERATION_CONSTANTS.STATUS_LABELS[status] || status;
|
||||
}
|
||||
|
||||
export function getSubmissionTypeLabel(type: keyof typeof MODERATION_CONSTANTS.SUBMISSION_TYPE_LABELS): string {
|
||||
return MODERATION_CONSTANTS.SUBMISSION_TYPE_LABELS[type] || type;
|
||||
}
|
||||
|
||||
export function getReportTypeLabel(type: keyof typeof MODERATION_CONSTANTS.REPORT_TYPE_LABELS): string {
|
||||
return MODERATION_CONSTANTS.REPORT_TYPE_LABELS[type] || type;
|
||||
}
|
||||
|
||||
export function getEntityTypeLabel(type: keyof typeof MODERATION_CONSTANTS.ENTITY_TYPE_LABELS): string {
|
||||
return MODERATION_CONSTANTS.ENTITY_TYPE_LABELS[type] || type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user