diff --git a/apps/portal/src/components/offers/analysis/OfferPercentileAnalysis.tsx b/apps/portal/src/components/offers/analysis/OfferPercentileAnalysis.tsx new file mode 100644 index 00000000..1f4107ca --- /dev/null +++ b/apps/portal/src/components/offers/analysis/OfferPercentileAnalysis.tsx @@ -0,0 +1,27 @@ +import type { Analysis } from '~/types/offers'; + +type OfferPercentileAnalysisProps = Readonly<{ + companyName: string; + offerAnalysis: Analysis; + tab: string; +}>; + +export default function OfferPercentileAnalysis({ + tab, + companyName, + offerAnalysis: { noOfOffers, percentile }, +}: OfferPercentileAnalysisProps) { + return tab === 'Overall' ? ( +
+ Your highest offer is from {companyName}, which is {percentile} percentile + out of {noOfOffers} offers received for the same job type, same level, and + same YOE(+/-1) in the last year. +
+ ) : ( ++ Your offer from {companyName} is {percentile} percentile out of{' '} + {noOfOffers} offers received in {companyName} for the same job type, same + level, and same YOE(+/-1) in the last year. +
+ ); +} diff --git a/apps/portal/src/components/offers/analysis/OfferProfileCard.tsx b/apps/portal/src/components/offers/analysis/OfferProfileCard.tsx new file mode 100644 index 00000000..9969c953 --- /dev/null +++ b/apps/portal/src/components/offers/analysis/OfferProfileCard.tsx @@ -0,0 +1,61 @@ +import { UserCircleIcon } from '@heroicons/react/24/outline'; + +import { HorizontalDivider } from '~/../../../packages/ui/dist'; +import { formatDate } from '~/utils/offers/time'; + +import { JobType } from '../types'; + +import type { AnalysisOffer } from '~/types/offers'; + +type OfferProfileCardProps = Readonly<{ + offerProfile: AnalysisOffer; +}>; + +export default function OfferProfileCard({ + offerProfile: { + company, + income, + profileName, + totalYoe, + level, + monthYearReceived, + jobType, + location, + title, + previousCompanies, + }, +}: OfferProfileCardProps) { + return ( +{profileName}
+Previous company: {previousCompanies[0]}
+YOE: {totalYoe} year(s)
+{title}
++ Company: {company.name}, {location} +
+Level: {level}
+{formatDate(monthYearReceived)}
++ {jobType === JobType.FullTime + ? `$${income} / year` + : `$${income} / month`} +
+- Your highest offer is from {result.company}, which is {result.percentile}{' '} - percentile out of {result.numberOfOffers} offers received in Singapore for - the same job type, same level, and same YOE in the last year. -
- ); -} - -function OfferProfileCard() { - return ( -profile-name
-Previous company: Meta, Singapore
-YOE: 4 years
-Software engineer
-Company: Google, Singapore
-Level: G4
-Sept 2022
-$125,000 / year
-+ You are the first to submit an offer for these companies! Check back + later when there are more submissions. +
+ ); + } + return ( + <> +