'use client'; import { useAuth } from '@/hooks/useAuth'; import { useWalletConnection } from '@/hooks/useWalletConnection'; import { ReactNode } from 'react'; interface AuthGuardProps { children: ReactNode; fallback?: ReactNode; } /** * Component that requires authentication * Shows fallback or warning if user is not authenticated */ export function AuthGuard({ children, fallback }: AuthGuardProps) { const { isConnected } = useWalletConnection(); const { isAuthenticated, authenticate, isAuthenticating } = useAuth(); if (!isConnected) { return ( fallback || (
Please connect your wallet to access this feature.
Please sign a message to verify your wallet ownership.