kanban-app/frontend/src/pages/Boards.tsx

46 lines
1.5 KiB
TypeScript
Raw Normal View History

import { Link } from 'react-router-dom';
import { useBoards } from '../hooks/useBoards';
import { BoardCard } from '../components/kanban/BoardCard';
2026-03-20 15:08:39 +00:00
import { NarrowPageLayout } from '@/components/NarrowPageLayout';
export function Boards() {
const { boards, deleteBoard } = useBoards();
return (
2026-03-20 15:08:39 +00:00
<NarrowPageLayout>
<div className="space-y-6">
<div className="flex justify-between items-center">
<div>
<h1 className="text-3xl font-bold text-white mb-2">My Boards</h1>
<p className="text-gray-400">Manage your Kanban boards</p>
</div>
<Link
to="/boards/new"
2026-03-20 15:08:39 +00:00
className="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition-colors"
>
2026-03-20 15:08:39 +00:00
+ Create Board
</Link>
</div>
2026-03-20 15:08:39 +00:00
{boards.length === 0 ? (
<div className="text-center py-16">
<p className="text-gray-400 text-lg mb-4">No boards yet</p>
<Link
to="/boards/new"
className="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-6 rounded-lg transition-colors inline-block"
>
Create your first board
</Link>
</div>
) : (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{boards.map((board) => (
<BoardCard key={board.id} board={board} onDelete={deleteBoard} />
))}
</div>
)}
</div>
</NarrowPageLayout>
);
}