Skip to content

Commit

Permalink
rka-27: handle empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
konstrybakov committed Jul 25, 2024
1 parent 4b4a52c commit 5403415
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
22 changes: 16 additions & 6 deletions emails/jobs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,24 @@ const Jobs = ({
</Head>
<main className="md:container mx-auto">
<h2>✨ New Jobs</h2>
{Object.entries(newJobsGrouped).map(([company, jobs]) => (
<CompanyJobs key={company} company={company} jobs={jobs} />
))}

{newJobs.length ? (
Object.entries(newJobsGrouped).map(([company, jobs]) => (
<CompanyJobs key={company} company={company} jobs={jobs} />
))
) : (
<p>💦 No new jobs found</p>
)}

<h2>♥️ Saved Jobs</h2>
{Object.entries(savedJobsGrouped).map(([company, jobs]) => (
<CompanyJobs key={company} company={company} jobs={jobs} />
))}

{savedJobs.length ? (
Object.entries(savedJobsGrouped).map(([company, jobs]) => (
<CompanyJobs key={company} company={company} jobs={jobs} />
))
) : (
<p>😭 No saved jobs found</p>
)}
</main>
</Tailwind>
)
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"db:generate": "drizzle-kit generate --config drizzle.config.ts",
"db:migrate": "bun run lib/db/migrate.ts",
"db:reset": "bun run lib/db/reset.ts",
"prepare": "husky"
"prepare": "husky",
"email:dev": "email dev"
},
"dependencies": {
"@clerk/nextjs": "^5.1.4",
Expand All @@ -23,6 +24,7 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/themes": "^3.0.5",
"@react-email/components": "0.0.21",
"drizzle-orm": "^0.31.0",
"http-status-codes": "^2.3.0",
"jotai": "^2.8.1",
Expand All @@ -32,7 +34,9 @@
"pino-pretty": "^11.1.0",
"react": "^18",
"react-dom": "^18",
"react-email": "2.1.5",
"react-hook-form": "^7.51.5",
"resend": "^3.4.0",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down

0 comments on commit 5403415

Please sign in to comment.