import type { AuthSessionState } from '@/business/auth/types';
import type {
  CampusInfo,
  UserRole,
} from '@/shared/types/app';

export interface TopBarProps {
  readonly userRole: UserRole;
  readonly userName: string;
  readonly campusInfo?: CampusInfo;
  readonly toggleSidebar: () => void;
}

export interface TopBarNotification {
  readonly id: string;
  readonly text: string;
  readonly time: string;
  readonly unread: boolean;
}

export interface UseTopBarPageOptions extends TopBarProps {
  readonly profile: AuthSessionState['profile'];
  readonly signOut: AuthSessionState['signOut'];
}

export interface TopBarPage {
  readonly userRole: UserRole;
  readonly userName: string;
  readonly campusInfo?: CampusInfo;
  readonly profileRoleLabel: string;
  readonly roleLabel: string;
  readonly initials: string;
  readonly campusLabel: string;
  readonly showProfileMenu: boolean;
  readonly showNotifications: boolean;
  readonly searchQuery: string;
  readonly signOutError: string | null;
  readonly notifications: readonly TopBarNotification[];
  readonly unreadCount: number;
  readonly toggleSidebar: () => void;
  readonly toggleProfileMenu: () => void;
  readonly closeProfileMenu: () => void;
  readonly toggleNotifications: () => void;
  readonly closeNotifications: () => void;
  readonly setSearchQuery: (value: string) => void;
  readonly signOut: () => Promise<void>;
}
