'use client';

export function useAuth() {
  const isLoggedIn = () => {
    if (typeof window === 'undefined') return false;
    return !!localStorage.getItem('dev_user');
  };

  const getUser = () => {
    if (typeof window === 'undefined') return null;
    const user = localStorage.getItem('dev_user');
    return user ? JSON.parse(user) : null;
  };

  const logout = () => {
    localStorage.removeItem('dev_user');
    window.location.href = '/signin';
  };

  return { isLoggedIn, getUser, logout };
} 