orgNotificationTypeLabels function
- AppLocalizations l10n,
- String type
Localized (label, description) for an org notification_type wire value.
Unknown types fall back to the raw value with an empty description, so a type added server-side still renders something rather than blank.
Implementation
(String, String) orgNotificationTypeLabels(
AppLocalizations l10n,
String type,
) => switch (type) {
'assignment_created' => (
l10n.notifTypeAssignmentCreated,
l10n.notifTypeAssignmentCreatedDesc,
),
'due_date_approaching' => (
l10n.notifTypeDueDateApproaching,
l10n.notifTypeDueDateApproachingDesc,
),
'assignment_overdue' => (
l10n.notifTypeAssignmentOverdue,
l10n.notifTypeAssignmentOverdueDesc,
),
'mastery_milestone' => (
l10n.notifTypeMasteryMilestone,
l10n.notifTypeMasteryMilestoneDesc,
),
'member_joined' => (
l10n.notifTypeMemberJoined,
l10n.notifTypeMemberJoinedDesc,
),
_ => (type, ''),
};