import React from 'react'; import { Link } from 'react-router-dom'; import { useAuth } from '@/contexts/AuthContext'; import { useForum } from '@/contexts/ForumContext'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { ShieldCheck, LogOut, Terminal, Wifi, WifiOff, Eye, MessageSquare, RefreshCw } from 'lucide-react'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; const Header = () => { const { currentUser, isAuthenticated, verificationStatus, connectWallet, disconnectWallet, verifyOrdinal } = useAuth(); const { isNetworkConnected, isRefreshing } = useForum(); const handleConnect = async () => { await connectWallet(); }; const handleDisconnect = () => { disconnectWallet(); }; const handleVerify = async () => { await verifyOrdinal(); }; const renderAccessBadge = () => { if (verificationStatus === 'unverified') { return ( ); } if (verificationStatus === 'verifying') { return ( Verifying... ); } if (verificationStatus === 'verified-none') { return (
Read-Only Access

Wallet Verified - No Ordinals Found

Your wallet has been verified but does not contain any Ordinal Operators.

You can browse content but cannot post, comment, or vote.

Verify again

); } if (verificationStatus === 'verified-owner') { return (
Full Access

Ordinal Operators Verified!

You have full forum access with permission to post, comment, and vote.

Verify again

); } return null; }; return (
OpChan PoC v0.1
{isNetworkConnected ? ( <> Connected ) : ( <> Offline )}

{isNetworkConnected ? "Connected to Waku network" : "Not connected to Waku network. Some features may be unavailable."}

{isRefreshing &&

Refreshing data...

}
{!currentUser ? ( ) : ( <> {renderAccessBadge()} {currentUser.address.slice(0, 6)}...{currentUser.address.slice(-4)} )}
); }; export default Header;