-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Simon Huang
authored and
Simon Huang
committed
Oct 12, 2024
1 parent
fb99d44
commit 13b9061
Showing
7 changed files
with
68 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { Card, CardContent, CardHeader, CardTitle } from "@components/ui/card"; | ||
import { mapPathnameToBreadcrumbs } from "@components/ui/page-breadcrumbs"; | ||
import { PageHeading } from "@components/ui/page-heading"; | ||
import { cn } from "@lib/utils"; | ||
import { headers } from "next/headers"; | ||
import { redirect } from "next/navigation"; | ||
import { getServerAuthSession } from "server/auth"; | ||
import db from "server/db"; | ||
|
||
interface Props { | ||
params: { | ||
opportunity_id: string; | ||
}; | ||
} | ||
|
||
export default async function OpportunityPage({ params }: Props) { | ||
const session = await getServerAuthSession(); | ||
if (!session?.user.id) redirect("/auth"); | ||
|
||
const opportunityId = Number(params.opportunity_id); | ||
const opportunity = await db.opportunity.findUnique({ | ||
where: { id: opportunityId }, | ||
}); | ||
|
||
if (!opportunity) redirect("/404"); | ||
|
||
const headerList = headers(); | ||
const breadcrumbs = await mapPathnameToBreadcrumbs(headerList); | ||
|
||
return ( | ||
<div className="space-y-8 py-8"> | ||
<PageHeading | ||
title={opportunity.title} | ||
description={opportunity.description ?? undefined} | ||
breadcrumbs={breadcrumbs} | ||
/> | ||
|
||
<div className="grid grid-cols-3 gap-4"> | ||
{[ | ||
{ href: "applications", label: "Applications" }, | ||
{ href: "applications", label: "Review" }, | ||
{ href: "applications", label: "Dashboard" }, | ||
].map((item) => ( | ||
<Card | ||
className={cn( | ||
"flex h-full w-full flex-col justify-between overflow-hidden", | ||
)} | ||
> | ||
<CardHeader className="p-4"> | ||
<CardTitle className="truncate text-lg">{item.label}</CardTitle> | ||
</CardHeader> | ||
<CardContent></CardContent> | ||
</Card> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters