/* * File: authSelectors.ts * Description: Selectors for Auth redux state * Design & Developed by Tech4Biz Solutions * Copyright (c) Spurrin Innovations. All rights reserved. */ import { RootState } from '../../../store'; export const selectUser = (state: RootState) => state.auth.user; export const selectAuthLoading = (state: RootState) => state.auth.loading; export const selectAuthError = (state: RootState) => state.auth.error; export const selectIsAuthenticated = (state: RootState) => state.auth.isAuthenticated; export const selectHospitals = (state: RootState) => state.hospital.hospitals; // User profile selectors export const selectUserProfile = (state: RootState) => state.auth.user; export const selectUserDisplayName = (state: RootState) => state.auth.user?.display_name; export const selectUserEmail = (state: RootState) => state.auth.user?.email; export const selectUserFirstName = (state: RootState) => state.auth.user?.first_name; export const selectUserLastName = (state: RootState) => state.auth.user?.last_name; export const selectUserHospitalId = (state: RootState) => state.auth.user?.hospital_id; export const selectUserProfilePhoto = (state: RootState) => state.auth.user?.profile_photo_url; export const selectUserThemeColor = (state: RootState) => state.auth.user?.theme_color; export const selectUserAccentColor = (state: RootState) => state.auth.user?.accent_color; // Onboarding selectors export const selectIsOnboarded = (state: RootState) => state.auth.user?.onboarded; export const selectOnboardingCompleted = (state: RootState) => state.auth.user?.onboarding_completed; export const selectOnboardingStep = (state: RootState) => state.auth.user?.onboarding_step; export const selectOnboardingMessage = (state: RootState) => state.auth.user?.onboarding_message; // Dashboard settings selectors export const selectDashboardSettings = (state: RootState) => state.auth.user?.dashboard_settings; export const selectDashboardTheme = (state: RootState) => state.auth.user?.dashboard_settings?.theme; export const selectDashboardLanguage = (state: RootState) => state.auth.user?.dashboard_settings?.language; export const selectDashboardTimezone = (state: RootState) => state.auth.user?.dashboard_settings?.timezone; // Notification preferences selectors export const selectNotificationPreferences = (state: RootState) => state.auth.user?.notification_preferences; export const selectCriticalAlertsPreferences = (state: RootState) => state.auth.user?.notification_preferences?.critical_alerts; export const selectSystemNotificationsPreferences = (state: RootState) => state.auth.user?.notification_preferences?.system_notifications; /* * End of File: authSelectors.ts * Design & Developed by Tech4Biz Solutions * Copyright (c) Spurrin Innovations. All rights reserved. */