import { Button } from '@/components/ui/button'; import { LayoutGrid, Folder, Plus } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import type { Board } from '../api/types'; import { useAuth } from '../hooks/useAuth'; interface Props { boards: Board[]; loading?: boolean; selectedId?: number; onSelect: (id: number) => void; } export default function BoardGrid({ boards, loading = false, selectedId = 0, onSelect }: Props) { const nav = useNavigate(); const { user } = useAuth(); if (loading) { return (
{user?.role === 'admin' ? '还没有板块,请先创建' : '管理员尚未创建板块'}
{user?.role === 'admin' && (