import { useContext } from 'react'; import { AuthContext, type AuthState } from '../components/auth/AuthProvider'; /** * Access the atproto OAuth auth state from any component. */ export function useAuth(): AuthState { const context = useContext(AuthContext); if (!context) { throw new Error('useAuth must be used within an AuthProvider'); } return context; }