import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.tsx'

export function getToken() {
  return localStorage.getItem('gpi_token');
}

export function getUser() {
  const user = localStorage.getItem('gpi_user');
  return user ? JSON.parse(user) : null;
}

export function setUser(token: string, user: any) {
  localStorage.setItem('gpi_token', token);
  localStorage.setItem('gpi_user', JSON.stringify(user));
}

createRoot(document.getElementById('root')!).render(<App />)