Skip to content

Commit

Permalink
Konstantin/rka 21 add job actions (#6)
Browse files Browse the repository at this point in the history
* rka-21: move files around

* rka-21: add job card actions

* rka-21: clean up layout a bit

* rka-21: add husky pre-commits and fix types

* rka-21: protect actions
  • Loading branch information
konstrybakov authored Jun 12, 2024
1 parent e648370 commit 87ef8c8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/components/list/job-card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { isAdmin } from '@/lib/auth/is-admin'
import type { QueryGetJobsResult } from '@/lib/db/queries'
import { type User, currentUser } from '@clerk/nextjs/server'
import { ExternalLinkIcon } from '@radix-ui/react-icons'
import {
AccessibleIcon,
Expand All @@ -20,6 +22,8 @@ type JobCardProps = {

// TODO: design, refactor
export const JobCard = async ({ job }: JobCardProps) => {
const user = (await currentUser()) as User

return (
<Card>
<Grid columns="2" gap="2">
Expand Down Expand Up @@ -54,9 +58,11 @@ export const JobCard = async ({ job }: JobCardProps) => {
}).format(new Date(job.lastUpdatedAt))}
</Text>
</Flex>
<Flex align="center" gridColumn="1/-1" gap="2" justify="end">
<JobCardActions job={job} />
</Flex>
{isAdmin(user) && (
<Flex align="center" gridColumn="1/-1" gap="2" justify="end">
<JobCardActions job={job} />
</Flex>
)}
</Grid>
</Card>
)
Expand Down

0 comments on commit 87ef8c8

Please sign in to comment.