diff --git a/src/components/all-jobs.tsx b/src/components/all-jobs.tsx index 4a5f8f2c..d3e46914 100644 --- a/src/components/all-jobs.tsx +++ b/src/components/all-jobs.tsx @@ -10,12 +10,35 @@ import { Pagination, PaginationContent, PaginationItem } from './ui/pagination'; import { PaginationPages } from './ui/paginator'; import JobCard from './Jobcard'; import APP_PATHS from '@/config/path.config'; +import { getServerSession } from 'next-auth'; +import { options } from '@/lib/auth'; +import { FormContainer } from '@/layouts/form-container'; +import { Button } from './ui/button'; +import Link from 'next/link'; type PaginatorProps = { searchParams: JobQuerySchemaType; }; const AllJobs = async ({ searchParams }: PaginatorProps) => { + const session = await getServerSession(options); + + // If no session exists, show a login/register prompt + if (!session || !session.user) { + return ( + + + + + + ); + } + const [jobs, getUserBookmarks] = await Promise.all([ await getAllJobs(searchParams), await GetUserBookmarksId(),