import { IUser } from './user.d';
// #ifdef DEV
import dictionary from './user.store';
console.log('port :>> ', location.port);
console.log('dictionary[location.port] :>> ', dictionary[location.port]);
localStorage.setItem(
  "userInfo",
  JSON.stringify(
    dictionary[location.port]
  )
)
// #endif

let user = reactive<IUser>(JSON.parse(localStorage.getItem('userInfo') as string))
console.log('user :>> ', user);
export default user

const ROLE_MAP: { [key: string]: 'teacher' | 'student' } = { '72': 'teacher', '75': 'teacher', '76': 'student' }
export const UserRole: 'teacher' | 'student' | 'other' = ROLE_MAP[user.user_role_id] ?? 'other'
