'use client';
import { isAdmin, getSession } from '@/lib/store/auth-store';
import { ShieldAlert, User } from 'lucide-react';
function ViewerNotice() {
const session = getSession();
return (
{session && (
当前用户:{session.name}
观众
)}
返回首页
);
}
export function AdminGate({ children, fallback }: { children: React.ReactNode; fallback?: React.ReactNode }) {
if (!isAdmin()) return fallback || ;
return <>{children}>;
}