diff --git a/apps/portal/src/components/resumes/browse/ResumeListItem.tsx b/apps/portal/src/components/resumes/browse/ResumeListItem.tsx index c7f7677a..0d0a2756 100644 --- a/apps/portal/src/components/resumes/browse/ResumeListItem.tsx +++ b/apps/portal/src/components/resumes/browse/ResumeListItem.tsx @@ -1,9 +1,17 @@ import formatDistanceToNow from 'date-fns/formatDistanceToNow'; import Link from 'next/link'; +import { useSession } from 'next-auth/react'; import type { UrlObject } from 'url'; import { ChevronRightIcon } from '@heroicons/react/20/solid'; +import { + AcademicCapIcon, + BriefcaseIcon, + StarIcon as ColouredStarIcon, +} from '@heroicons/react/20/solid'; import { ChatBubbleLeftIcon, StarIcon } from '@heroicons/react/24/outline'; +import { trpc } from '~/utils/trpc'; + import type { Resume } from '~/types/resume'; type Props = Readonly<{ @@ -12,24 +20,47 @@ type Props = Readonly<{ }>; export default function BrowseListItem({ href, resumeInfo }: Props) { + const { data: sessionData } = useSession(); + + // Find out if user has starred this particular resume + const resumeId = resumeInfo.id; + const isStarredQuery = trpc.useQuery([ + 'resumes.resume.user.isResumeStarred', + { resumeId }, + ]); + return ( -