Skip to content

Commit

Permalink
fixed the build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashyap1ankit committed Oct 20, 2024
1 parent 52606a1 commit 7e2f0cb
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/components/RecentJobs.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
import { getRecentJobs } from '@/actions/job.action';
import { getRecentJobs, GetUserBookmarksId } from '@/actions/job.action';
import JobCard from './Jobcard';

export default async function RecentJobs() {
const recentJobs = await getRecentJobs();
const [recentJobs, getUserBookmarks] = await Promise.all([
await getRecentJobs(),
await GetUserBookmarksId(),
]);

const userbookmarkArr: { jobId: string }[] | null = getUserBookmarks.data;

if (!recentJobs.status) {
return <div>{recentJobs.message}</div>;
}

return (
<div className="w-full grid md:grid-cols-3 grid-cols-1 gap-6 items-center mt-10">
{recentJobs.additional.recentJobs.map((job, index) => (
<JobCard job={job} key={index} className="min-h-[210px]" />
<JobCard
job={job}
key={index}
className="min-h-[210px]"
isBookmarked={
userbookmarkArr?.some((e) => e.jobId === job.id) || false
}
/>
))}
</div>
);
Expand Down

0 comments on commit 7e2f0cb

Please sign in to comment.