MCPcopy Create free account
hub / github.com/ShipSecAI/studio / UserButtonText

Function UserButtonText

frontend/src/components/auth/UserButton.tsx:195–216  ·  view source on GitHub ↗
({ className = '' })

Source from the content-addressed store, hash-verified

193
194// Text-based version for mobile or accessibility
195export 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};

Callers

nothing calls this directly

Calls 1

useAuthProviderFunction · 0.85

Tested by

no test coverage detected