"use client"; import React, { createContext, useContext } from 'react'; import { useAuthCore } from '@/hooks/use-auth'; import { LoadingScreen } from '@/components/loading-screen'; type AuthContextValue = ReturnType; const AuthContext = createContext(null); export const useAuth = () => { const context = useContext(AuthContext); if (!context) { throw new Error('useAuth must be used within an AuthProvider'); } return context; }; export const AuthProvider = ({ children }: { children: React.ReactNode }) => { const authData = useAuthCore(); return ( {authData.authStatus === 'loading' ? ( ) : ( children )} ); };