mirror of
https://github.com/SrIzan10/echospace.git
synced 2026-06-06 00:56:54 +00:00
feat: no projects found button
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import ProjectCard from '@/components/app/ProjectCard/ProjectCard';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { validateRequest } from '@/lib/auth';
|
||||
import prisma from '@/lib/db';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default async function Page() {
|
||||
const { user } = await validateRequest();
|
||||
@@ -12,6 +13,15 @@ export default async function Page() {
|
||||
});
|
||||
return (
|
||||
<div className="grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 p-4">
|
||||
{db.length === 0 && (
|
||||
<div className="col-span-full text-center">
|
||||
<h1 className="text-2xl font-bold">No projects found</h1>
|
||||
<p className="text-muted-foreground">Create a project to get started</p>
|
||||
<Link href="/create">
|
||||
<Button size={'sm'}>Create Project</Button>
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
{db.map((d) => (
|
||||
<ProjectCard key={d.id} {...d} />
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user