forked from carrydela/Rs_blog_front
feature: add draft
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { useSyncExternalStore } from "react";
|
||||
import Link from "next/link";
|
||||
import { Container } from "./Container";
|
||||
import { TextLink } from "@/components/ui/TextLink";
|
||||
import { useAuth } from "@/lib/hooks/useAuth";
|
||||
|
||||
const subscribe = () => () => {};
|
||||
const getSnapshot = () => true;
|
||||
const getServerSnapshot = () => false;
|
||||
|
||||
export function Header() {
|
||||
const { isAuthenticated, logout } = useAuth();
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
const mounted = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
||||
|
||||
return (
|
||||
<header className="py-8 border-b border-neutral-100">
|
||||
@@ -31,6 +31,7 @@ export function Header() {
|
||||
{isAuthenticated ? (
|
||||
<>
|
||||
<TextLink href="/admin">Dashboard</TextLink>
|
||||
<TextLink href="/drafts">My Drafts</TextLink>
|
||||
<button
|
||||
onClick={logout}
|
||||
className="text-sm tracking-wide uppercase text-neutral-500 hover:text-black transition-colors"
|
||||
|
||||
Reference in New Issue
Block a user