Skip to content

Commit

Permalink
fix / project slug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
psiddharthdesign committed Jul 30, 2024
1 parent 4c291f7 commit 714099d
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// https://github.com/vercel/next.js/issues/58272
import { T } from '@/components/ui/Typography';
import { Skeleton } from '@/components/ui/skeleton';
import { getProjectById, getSlimProjectBySlug } from '@/data/user/projects';
import { getSlimProjectBySlug } from '@/data/user/projects';
import { projectSlugParamSchema } from '@/utils/zod-schemas/params';
import { Layers } from 'lucide-react';
import Link from 'next/link';

import { Suspense } from 'react';

async function Title({ projectId }: { projectId: string }) {
const project = await getProjectById(projectId);
const project = await getSlimProjectBySlug(projectId);
return (
<div className="flex items-center gap-2">
<Layers className="w-4 h-4" />
Expand All @@ -23,13 +23,12 @@ async function Title({ projectId }: { projectId: string }) {

export default async function ProjectNavbar({ params }: { params: unknown }) {
const { projectSlug } = projectSlugParamSchema.parse(params);
const project = await getSlimProjectBySlug(projectSlug);
return (
<div className="flex items-center">
<Link href={`/project/${project.id}`}>
<Link href={`/project/${projectSlug}`}>
<span className="flex items-center space-x-2">
<Suspense fallback={<Skeleton className="w-16 h-6" />}>
<Title projectId={project.slug} />
<Title projectId={projectSlug} />
</Suspense>
</span>
</Link>
Expand Down

0 comments on commit 714099d

Please sign in to comment.