"use client"; import { useEffect, useRef } from "react"; import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Archive, LogIn, LogOut, ScrollText, Settings, Sparkles, UserCircle } from "lucide-react"; import clsx from "clsx"; import { revealChildren, runScopedMotion } from "@/lib/ui/motion"; import type { AuthUser } from "@/lib/auth/session"; const nav = [ { href: "/create", label: "创作", icon: Sparkles }, { href: "/assets", label: "结果", icon: Archive }, { href: "/logs", label: "日志", icon: ScrollText }, { href: "/settings", label: "设置", icon: Settings } ]; export function AppShell({ children, user, authRequired }: { children: React.ReactNode; user?: AuthUser | null; authRequired?: boolean; }) { const pathname = usePathname(); const shellRef = useRef(null); const isAuthPage = pathname.startsWith("/auth"); useEffect(() => { return runScopedMotion(shellRef, (scope) => revealChildren(scope, "[data-shell-animate]")); }, []); return (
{!isAuthPage ? 跳到主要内容 : null} {!isAuthPage ? (
智念AIGC平台
{user ? ( <>
) : authRequired ? (
) : null}
{children}
); }