({ className = '' })
| 193 | |
| 194 | // Text-based version for mobile or accessibility |
| 195 | export const UserButtonText: React.FC<{ className?: string }> = ({ className = '' }) => { |
| 196 | const authProvider = useAuthProvider(); |
| 197 | const { user, isAuthenticated, isLoading } = authProvider.context; |
| 198 | |
| 199 | if (isLoading) { |
| 200 | return <div className={`animate-pulse w-16 h-4 bg-muted rounded ${className}`}></div>; |
| 201 | } |
| 202 | |
| 203 | if (!isAuthenticated || !user) { |
| 204 | return ( |
| 205 | <Button variant="ghost" size="sm" onClick={authProvider.signIn} className={className}> |
| 206 | Sign In |
| 207 | </Button> |
| 208 | ); |
| 209 | } |
| 210 | |
| 211 | return ( |
| 212 | <Button variant="ghost" size="sm" onClick={() => authProvider.signOut()} className={className}> |
| 213 | Sign Out |
| 214 | </Button> |
| 215 | ); |
| 216 | }; |
nothing calls this directly
no test coverage detected