From 4d67f92f14ad93c4decaac6fc68ddb80b9af9639 Mon Sep 17 00:00:00 2001 From: Ai Ling Date: Sat, 5 Nov 2022 00:45:23 +0800 Subject: [PATCH] [offers][feat] Add view more button to OEA --- .../offers/offerAnalysis/OfferAnalysis.tsx | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx index ab80bb48..1d8aa2ae 100644 --- a/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx +++ b/apps/portal/src/components/offers/offerAnalysis/OfferAnalysis.tsx @@ -1,10 +1,13 @@ import { useEffect } from 'react'; import { useState } from 'react'; -import { Alert, HorizontalDivider, Spinner, Tabs } from '@tih/ui'; +import { ArrowUpRightIcon } from '@heroicons/react/24/outline'; +import { JobType } from '@prisma/client'; +import { Alert, Button, HorizontalDivider, Spinner, Tabs } from '@tih/ui'; import OfferPercentileAnalysisText from './OfferPercentileAnalysisText'; import OfferProfileCard from './OfferProfileCard'; import { OVERALL_TAB } from '../constants'; +import { YOE_CATEGORY } from '../table/types'; import type { AnalysisUnit, ProfileAnalysis } from '~/types/offers'; @@ -19,6 +22,16 @@ function OfferAnalysisContent({ tab, isSubmission, }: OfferAnalysisContentProps) { + const { companyId, companyName, title, totalYoe, jobType } = analysis; + const yoeCategory = + jobType === JobType.INTERN + ? '' + : totalYoe <= 2 + ? YOE_CATEGORY.ENTRY + : totalYoe <= 5 + ? YOE_CATEGORY.MID + : YOE_CATEGORY.SENIOR; + if (!analysis || analysis.noOfOffers === 0) { if (tab === OVERALL_TAB) { return ( @@ -55,15 +68,22 @@ function OfferAnalysisContent({ offerProfile={topPercentileOffer} /> ))} - {/* {offerAnalysis.topPercentileOffers.length > 0 && ( + {analysis.topPercentileOffers.length > 0 && (
- )} */} + )} ); } @@ -133,4 +153,4 @@ export default function OfferAnalysis({ )} ); -} \ No newline at end of file +}