|
|
@ -1,4 +1,10 @@
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
|
|
|
|
ArrowTrendingUpIcon,
|
|
|
|
|
|
|
|
BuildingOfficeIcon,
|
|
|
|
|
|
|
|
MapPinIcon,
|
|
|
|
|
|
|
|
} from '@heroicons/react/20/solid';
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
|
|
ArrowTopRightOnSquareIcon,
|
|
|
|
BuildingOffice2Icon,
|
|
|
|
BuildingOffice2Icon,
|
|
|
|
CalendarDaysIcon,
|
|
|
|
CalendarDaysIcon,
|
|
|
|
} from '@heroicons/react/24/outline';
|
|
|
|
} from '@heroicons/react/24/outline';
|
|
|
@ -7,9 +13,8 @@ import { JobType } from '@prisma/client';
|
|
|
|
import type { JobTitleType } from '~/components/shared/JobTitles';
|
|
|
|
import type { JobTitleType } from '~/components/shared/JobTitles';
|
|
|
|
import { getLabelForJobTitleType } from '~/components/shared/JobTitles';
|
|
|
|
import { getLabelForJobTitleType } from '~/components/shared/JobTitles';
|
|
|
|
|
|
|
|
|
|
|
|
import { HorizontalDivider } from '~/../../../packages/ui/dist';
|
|
|
|
import { Button } from '~/../../../packages/ui/dist';
|
|
|
|
import { convertMoneyToString } from '~/utils/offers/currency';
|
|
|
|
import { convertMoneyToString } from '~/utils/offers/currency';
|
|
|
|
import { getCompanyDisplayText } from '~/utils/offers/string';
|
|
|
|
|
|
|
|
import { formatDate } from '~/utils/offers/time';
|
|
|
|
import { formatDate } from '~/utils/offers/time';
|
|
|
|
|
|
|
|
|
|
|
|
import { JobTypeLabel } from '../constants';
|
|
|
|
import { JobTypeLabel } from '../constants';
|
|
|
@ -36,52 +41,109 @@ export default function OfferProfileCard({
|
|
|
|
profileId,
|
|
|
|
profileId,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}: OfferProfileCardProps) {
|
|
|
|
}: OfferProfileCardProps) {
|
|
|
|
return (
|
|
|
|
function UpperSection() {
|
|
|
|
<a
|
|
|
|
return (
|
|
|
|
className="my-5 block rounded-lg border bg-white p-4 px-8 shadow-md"
|
|
|
|
<div className="border-b px-4 py-5 sm:px-6">
|
|
|
|
href={`/offers/profile/${profileId}`}
|
|
|
|
<div className="-ml-4 -mt-4 flex flex-wrap items-center justify-between sm:flex-nowrap">
|
|
|
|
rel="noreferrer"
|
|
|
|
<div className="ml-4 mt-4">
|
|
|
|
target="_blank">
|
|
|
|
<div className="flex items-center">
|
|
|
|
<div className="flex items-center gap-x-5">
|
|
|
|
<div className="flex-shrink-0">
|
|
|
|
<div>
|
|
|
|
<ProfilePhotoHolder size="sm" />
|
|
|
|
<ProfilePhotoHolder size="sm" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="ml-4">
|
|
|
|
<div className="col-span-10">
|
|
|
|
<h2 className="text-lg font-medium leading-6 text-slate-900">
|
|
|
|
<p className="font-bold">{profileName}</p>
|
|
|
|
{profileName}
|
|
|
|
{previousCompanies.length > 0 && (
|
|
|
|
</h2>
|
|
|
|
<div className="flex flex-row">
|
|
|
|
<p className="flex text-sm text-slate-500">
|
|
|
|
<BuildingOffice2Icon className="mr-2 h-5" />
|
|
|
|
<CalendarDaysIcon className="mr-2 h-5" />
|
|
|
|
<span className="mr-2 font-bold">Current:</span>
|
|
|
|
<span className="mr-2 font-bold">YOE:</span>
|
|
|
|
<span>{previousCompanies[0]}</span>
|
|
|
|
<span>{totalYoe}</span>
|
|
|
|
|
|
|
|
{previousCompanies.length > 0 && (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
<BuildingOffice2Icon className="ml-4 mr-2 h-5" />
|
|
|
|
|
|
|
|
<span className="mr-2 font-bold">Previous:</span>
|
|
|
|
|
|
|
|
<span>{previousCompanies[0]}</span>
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
<div className="flex flex-row">
|
|
|
|
<div className="ml-4 mt-4 flex flex-shrink-0">
|
|
|
|
<CalendarDaysIcon className="mr-2 h-5" />
|
|
|
|
<Button
|
|
|
|
<span className="mr-2 font-bold">YOE:</span>
|
|
|
|
href={`/offers/profile/${profileId}`}
|
|
|
|
<span>{totalYoe}</span>
|
|
|
|
icon={ArrowTopRightOnSquareIcon}
|
|
|
|
|
|
|
|
isLabelHidden={true}
|
|
|
|
|
|
|
|
label="View Profile"
|
|
|
|
|
|
|
|
rel="noreferrer"
|
|
|
|
|
|
|
|
size="md"
|
|
|
|
|
|
|
|
target="_blank"
|
|
|
|
|
|
|
|
variant="tertiary"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<HorizontalDivider />
|
|
|
|
function BottomSection() {
|
|
|
|
<div className="flex items-end justify-between">
|
|
|
|
return (
|
|
|
|
<div className="col-span-1 row-span-3">
|
|
|
|
<div className="px-4 py-4 sm:px-6">
|
|
|
|
<p className="font-bold">
|
|
|
|
<div className="flex items-end justify-between">
|
|
|
|
{getLabelForJobTitleType(title as JobTitleType)}{' '}
|
|
|
|
<div className="col-span-1 row-span-3">
|
|
|
|
{`(${JobTypeLabel[jobType]})`}
|
|
|
|
<h4 className="font-medium">
|
|
|
|
</p>
|
|
|
|
{getLabelForJobTitleType(title as JobTitleType)}{' '}
|
|
|
|
<p>{`Company: ${getCompanyDisplayText(company.name, location)}`}</p>
|
|
|
|
{jobType && <>({JobTypeLabel[jobType]})</>}
|
|
|
|
{level && <p>Level: {level}</p>}
|
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div className="mt-1 flex flex-col sm:mt-0 sm:flex-row sm:flex-wrap sm:space-x-4">
|
|
|
|
<div className="col-span-1 row-span-3">
|
|
|
|
{company?.name && (
|
|
|
|
<p className="text-end">{formatDate(monthYearReceived)}</p>
|
|
|
|
<div className="mt-2 flex items-center text-sm text-slate-500">
|
|
|
|
<p className="text-end text-xl">
|
|
|
|
<BuildingOfficeIcon
|
|
|
|
{jobType === JobType.FULLTIME
|
|
|
|
aria-hidden="true"
|
|
|
|
? `${convertMoneyToString(income)} / year`
|
|
|
|
className="mr-1.5 h-5 w-5 flex-shrink-0 text-slate-400"
|
|
|
|
: `${convertMoneyToString(income)} / month`}
|
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
{company.name}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
{location && (
|
|
|
|
|
|
|
|
<div className="mt-2 flex items-center text-sm text-slate-500">
|
|
|
|
|
|
|
|
<MapPinIcon
|
|
|
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
|
|
|
className="mr-1.5 h-5 w-5 flex-shrink-0 text-slate-400"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
{location.cityName}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
{level && (
|
|
|
|
|
|
|
|
<div className="mt-2 flex items-center text-sm text-slate-500">
|
|
|
|
|
|
|
|
<ArrowTrendingUpIcon
|
|
|
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
|
|
|
className="mr-1.5 h-5 w-5 flex-shrink-0 text-slate-400"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
{level}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="col-span-1 row-span-3">
|
|
|
|
|
|
|
|
<p className="text-end text-lg font-medium leading-6 text-slate-900">
|
|
|
|
|
|
|
|
{jobType === JobType.FULLTIME
|
|
|
|
|
|
|
|
? `${convertMoneyToString(income)} / year`
|
|
|
|
|
|
|
|
: `${convertMoneyToString(income)} / month`}
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p className="text-end text-sm text-slate-500">
|
|
|
|
|
|
|
|
{formatDate(monthYearReceived)}
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<div className="my-5 block rounded-lg border border-slate-200 bg-white">
|
|
|
|
|
|
|
|
<UpperSection />
|
|
|
|
|
|
|
|
<BottomSection />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|