Frontend: - Replace Next.js with Vite + React + TypeScript - Add new component architecture (app-shell, sidebar, dashboard modules) - Implement product modules: FRAME, safety protocols, walkthrough checkin, campus/staff attendance, personality quiz, sign language, classroom timer - Add shadcn/ui component library with Tailwind CSS - Remove legacy generated components, stores, and pages Backend: - Add product migrations: frame_entries, user_progress, safety_quiz_results, walkthrough_checkins, communication_events, personality_quiz_results, campus_attendance_config/summaries, staff_attendance_records, content_catalog - Add corresponding models, services, and routes - Implement cookie-based auth with refresh token rotation - Add content catalog seeder with product content - Migrate to ESLint flat config - Switch from yarn to npm Infrastructure: - Update .gitignore for new tooling - Add project documentation (CLAUDE.md, docs/) - Remove deprecated config files and yarn.lock Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
33 lines
893 B
TypeScript
33 lines
893 B
TypeScript
import { getAuthRoleLabel } from '@/business/auth/selectors';
|
|
import { DEFAULT_CAMPUS_LABEL } from '@/shared/constants/campusDisplay';
|
|
import type {
|
|
CampusInfo,
|
|
UserRole,
|
|
} from '@/shared/types/app';
|
|
import type { TopBarNotification } from '@/business/top-bar/types';
|
|
|
|
export function getTopBarInitials(name: string): string {
|
|
return name
|
|
.trim()
|
|
.split(/\s+/u)
|
|
.filter(Boolean)
|
|
.map((part) => part[0])
|
|
.join('')
|
|
.slice(0, 2)
|
|
.toUpperCase();
|
|
}
|
|
|
|
export function getTopBarCampusLabel(campusInfo?: CampusInfo): string {
|
|
return campusInfo?.fullName ?? DEFAULT_CAMPUS_LABEL;
|
|
}
|
|
|
|
export function getTopBarRoleLabel(role: UserRole): string {
|
|
return getAuthRoleLabel(role);
|
|
}
|
|
|
|
export function countUnreadTopBarNotifications(
|
|
notifications: readonly TopBarNotification[],
|
|
): number {
|
|
return notifications.filter((notification) => notification.unread).length;
|
|
}
|