A deployable markdown editor that connects with your self hosted files and lets you edit in a beautiful interface
at main 42 lines 1.3 kB view raw
1import { useCurrentUser, useLogout } from '../../lib/hooks/useAuth'; 2import { Button } from '../ui/button'; 3 4export function Header() { 5 const { data: user } = useCurrentUser(); 6 const logout = useLogout(); 7 8 return ( 9 <header className="border-b border-gray-200 bg-white"> 10 <div className="container mx-auto px-6 py-4 flex items-center justify-between"> 11 <div className="flex items-center gap-8"> 12 <h1 className="text-2xl font-bold" style={{ fontFamily: 'Archivo Black, sans-serif' }}> 13 MarkEdit 14 </h1> 15 </div> 16 17 {user && ( 18 <div className="flex items-center gap-4"> 19 <div className="flex items-center gap-3"> 20 {user.avatar_url && ( 21 <img 22 src={user.avatar_url} 23 alt={user.username} 24 className="w-8 h-8 rounded-full" 25 /> 26 )} 27 <span className="text-sm font-medium text-gray-700">{user.username}</span> 28 </div> 29 <Button 30 variant="ghost" 31 size="sm" 32 onClick={() => logout.mutate()} 33 disabled={logout.isPending} 34 > 35 {logout.isPending ? 'Logging out...' : 'Logout'} 36 </Button> 37 </div> 38 )} 39 </div> 40 </header> 41 ); 42}