@ -9,6 +9,18 @@ import {
} from '@heroicons/react/20/solid' ;
} from '@heroicons/react/20/solid' ;
import { ChatBubbleLeftIcon , StarIcon } from '@heroicons/react/24/outline' ;
import { ChatBubbleLeftIcon , StarIcon } from '@heroicons/react/24/outline' ;
import type {
ExperienceFilter ,
LocationFilter ,
RoleFilter ,
} from '~/utils/resumes/resumeFilters' ;
import {
EXPERIENCES ,
getFilterLabel ,
LOCATIONS ,
ROLES ,
} from '~/utils/resumes/resumeFilters' ;
import type { Resume } from '~/types/resume' ;
import type { Resume } from '~/types/resume' ;
type Props = Readonly < {
type Props = Readonly < {
@ -19,52 +31,59 @@ type Props = Readonly<{
export default function ResumeListItem ( { href , resumeInfo } : Props ) {
export default function ResumeListItem ( { href , resumeInfo } : Props ) {
return (
return (
< Link href = { href } >
< Link href = { href } >
< div className = "grid grid-cols-8 gap-4 border-b border-slate-200 p-4 hover:bg-slate-100" >
< div className = "grid grid-cols-8" >
< div className = "col-span-4" >
< div className = "col-span-7 grid gap-4 border-b border-slate-200 p-4 hover:bg-slate-100 sm:grid-cols-7" >
{ resumeInfo . title }
< div className = "sm:col-span-4" >
< div className = "text-primary-500 mt-2 flex items-center justify-start text-xs" >
{ resumeInfo . title }
< div className = "flex" >
< div className = "text-primary-500 mt-2 flex items-center justify-start text-xs" >
< BriefcaseIcon
< div className = "flex" >
aria - hidden = "true"
< BriefcaseIcon
className = "mr-1.5 h-4 w-4 flex-shrink-0"
aria - hidden = "true"
/ >
className = "mr-1.5 h-4 w-4 flex-shrink-0"
{ resumeInfo . role }
/ >
{ getFilterLabel ( ROLES , resumeInfo . role as RoleFilter ) }
< / div >
< div className = "ml-4 flex" >
< AcademicCapIcon
aria - hidden = "true"
className = "mr-1.5 h-4 w-4 flex-shrink-0"
/ >
{ getFilterLabel (
EXPERIENCES ,
resumeInfo . experience as ExperienceFilter ,
) }
< / div >
< / div >
< / div >
< div className = "ml-4 flex" >
< div className = "mt-4 flex justify-start text-xs text-slate-500" >
< AcademicCapIcon
< div className = "flex gap-2 pr-4" >
aria - hidden = "true"
< ChatBubbleLeftIcon className = "w-4" / >
className = "mr-1.5 h-4 w-4 flex-shrink-0"
{ ` ${ resumeInfo . numComments } comment ${
/ >
resumeInfo . numComments === 1 ? '' : 's'
{ resumeInfo . experience }
} ` }
< / div >
< div className = "flex gap-2" >
{ resumeInfo . isStarredByUser ? (
< ColouredStarIcon className = "w-4 text-yellow-400" / >
) : (
< StarIcon className = "w-4" / >
) }
{ ` ${ resumeInfo . numStars } star ${
resumeInfo . numStars === 1 ? '' : 's'
} ` }
< / div >
< / div >
< / div >
< / div >
< / div >
< div className = "mt-4 flex justify-start text-xs text-slate-500" >
< div className = "self-center text-sm text-slate-500 sm:col-span-3" >
< div className = "flex gap-2 pr-4" >
< div >
< ChatBubbleLeftIcon className = "w-4" / >
{ ` Uploaded ${ formatDistanceToNow ( resumeInfo . createdAt , {
{ ` ${ resumeInfo . numComments } comment ${
addSuffix : true ,
resumeInfo . numComments === 1 ? '' : 's'
} ) } by $ { resumeInfo . user } ` }
} ` }
< / div >
< / div >
< div className = "flex gap-2" >
< div className = "mt-2 text-slate-400" >
{ resumeInfo . isStarredByUser ? (
{ getFilterLabel ( LOCATIONS , resumeInfo . location as LocationFilter ) }
< ColouredStarIcon className = "w-4 text-yellow-400" / >
) : (
< StarIcon className = "w-4" / >
) }
{ ` ${ resumeInfo . numStars } star ${
resumeInfo . numStars === 1 ? '' : 's'
} ` }
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< div className = "col-span-3 self-center text-sm text-slate-500" >
< div >
{ ` Uploaded ${ formatDistanceToNow ( resumeInfo . createdAt , {
addSuffix : true ,
} ) } by $ { resumeInfo . user } ` }
< / div >
< div className = "mt-2 text-slate-400" > { resumeInfo . location } < / div >
< / div >
< ChevronRightIcon className = "col-span-1 w-8 self-center justify-self-center text-slate-400" / >
< ChevronRightIcon className = "col-span-1 w-8 self-center justify-self-center text-slate-400" / >
< / div >
< / div >
< / Link >
< / Link >