import { useState, useEffect } from 'react';

function useAuth() {
  const [isAuthenticated, setIsAuthenticated] = useState<boolean>(false);

  useEffect(() => {
    const authStatus = localStorage.getItem('auth_key');
    setIsAuthenticated(authStatus !== '');
  }, []);

  return isAuthenticated;
}

export default useAuth;