mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
refactor: Simplify project type mapping in WorkspacePage
This commit is contained in:
@@ -16,7 +16,6 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com
|
|||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { auth } from '@/lib/auth';
|
import { auth } from '@/lib/auth';
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
import type { Prisma } from '@prisma/client';
|
|
||||||
|
|
||||||
function VisibilityIcon({ visibility }: { visibility: string }) {
|
function VisibilityIcon({ visibility }: { visibility: string }) {
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
@@ -145,9 +144,7 @@ export default async function WorkspacePage({ params }: WorkspacePageProps) {
|
|||||||
{/* Projects Grid */}
|
{/* Projects Grid */}
|
||||||
{workspace.projects.length > 0 ? (
|
{workspace.projects.length > 0 ? (
|
||||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
||||||
{workspace.projects.map((project: Prisma.ProjectGetPayload<{
|
{workspace.projects.map((project: (typeof workspace.projects)[number]) => (
|
||||||
include: { _count: { select: { videos: true; members: true } } };
|
|
||||||
}>) => (
|
|
||||||
<Link key={project.id} href={`/projects/${project.id}`}>
|
<Link key={project.id} href={`/projects/${project.id}`}>
|
||||||
<Card className="h-full transition-colors hover:bg-accent/50 cursor-pointer">
|
<Card className="h-full transition-colors hover:bg-accent/50 cursor-pointer">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
"prebuild": "bun run typecheck",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "eslint",
|
"lint": "eslint",
|
||||||
|
|||||||
Reference in New Issue
Block a user