refactor: Refine workspace project types

- Explicitly type `project` in `WorkspacePage`
- Add `typecheck` script to `package.json`
- Improve type safety and development experience
This commit is contained in:
Yusuf İpek
2026-02-07 17:13:32 +03:00
parent 98df611bf7
commit eef03a970c
2 changed files with 5 additions and 1 deletions
@@ -16,6 +16,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com
import { Badge } from '@/components/ui/badge';
import { auth } from '@/lib/auth';
import { db } from '@/lib/db';
import type { Prisma } from '@prisma/client';
function VisibilityIcon({ visibility }: { visibility: string }) {
switch (visibility) {
@@ -144,7 +145,9 @@ export default async function WorkspacePage({ params }: WorkspacePageProps) {
{/* Projects Grid */}
{workspace.projects.length > 0 ? (
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
{workspace.projects.map((project) => (
{workspace.projects.map((project: Prisma.ProjectGetPayload<{
include: { _count: { select: { videos: true; members: true } } };
}>) => (
<Link key={project.id} href={`/projects/${project.id}`}>
<Card className="h-full transition-colors hover:bg-accent/50 cursor-pointer">
<CardHeader>
+1
View File
@@ -7,6 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "eslint",
"typecheck": "tsc --noEmit",
"db:generate": "prisma generate",
"db:push": "prisma db push",
"db:migrate": "prisma migrate deploy",