refactor: remove licensing area display logic from ExperienceSection component
This commit is contained in:
@@ -8,12 +8,10 @@ interface ExperienceSectionProps {
|
||||
experience: ExperienceData;
|
||||
}
|
||||
|
||||
const INITIAL_DISPLAY_COUNT = 6;
|
||||
const EXPERTISE_INITIAL_COUNT = 4;
|
||||
const CERTIFICATIONS_INITIAL_COUNT = 2;
|
||||
|
||||
export function ExperienceSection({ experience }: ExperienceSectionProps) {
|
||||
const [showAllLicensing, setShowAllLicensing] = useState(false);
|
||||
const [showAllExpertise, setShowAllExpertise] = useState(false);
|
||||
const [showAllCertifications, setShowAllCertifications] = useState(false);
|
||||
|
||||
@@ -21,14 +19,10 @@ export function ExperienceSection({ experience }: ExperienceSectionProps) {
|
||||
const hasAgency = !!(experience.agencyName || experience.agencyDesignation);
|
||||
|
||||
// Calculate how many more items are hidden
|
||||
const licensingRemaining = experience.licensingAreas.length - INITIAL_DISPLAY_COUNT;
|
||||
const expertiseRemaining = experience.expertiseYears.length - EXPERTISE_INITIAL_COUNT;
|
||||
const certificationsRemaining = experience.certifications.length - CERTIFICATIONS_INITIAL_COUNT;
|
||||
|
||||
// Get displayed items
|
||||
const displayedLicensing = showAllLicensing
|
||||
? experience.licensingAreas
|
||||
: experience.licensingAreas.slice(0, INITIAL_DISPLAY_COUNT);
|
||||
const displayedExpertise = showAllExpertise
|
||||
? experience.expertiseYears
|
||||
: experience.expertiseYears.slice(0, EXPERTISE_INITIAL_COUNT);
|
||||
|
||||
Reference in New Issue
Block a user