import React from 'react'; import { useAuth } from 'react-oidc-context'; import { LogIn, LogOut, User, Loader2 } from 'lucide-react'; export const AuthButton: React.FC = () => { const auth = useAuth(); if (auth.isLoading) { return (
); } if (auth.error) { console.error('Auth error:', auth.error); return (
Auth Error: {auth.error.message}
); } if (auth.isAuthenticated) { return (
{auth.user?.profile.preferred_username || auth.user?.profile.name || 'User'}
); } return ( ); };