feature: add draft

This commit is contained in:
dela
2026-02-12 00:34:21 +08:00
parent 788de594f2
commit 5a618aac12
18 changed files with 1262 additions and 59 deletions

View File

@@ -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"