import { Button } from '@/components/ui/button'; import prisma from '@/lib/prisma'; import { PackagePlus, Plus } from 'lucide-react'; import CreateApplicationForm from './CreateApplicationForm'; import { getSession } from 'next-auth/react'; export default async function Workspace({ params }: { params: { workspace: string } }) { const applications = await prisma.application.findMany({ where: { Workspace: { name: params.workspace, }, }, }); const session = await getSession(); const account = await prisma.account.findFirst({ where: { userId: session?.user.id as string, }, }); fetch('https://api.github.com/users/fayorg/repos', { headers: { Authorization: `Bearer ${account?.access_token}`, }, }) .then((res) => res.json()) .then(console.log); if (applications.length == 0) { return (

Applications

No applications

Get started by creating a new app.

); } return (

Applications

); }