refactor: remove licensing area display logic from ExperienceSection component

This commit is contained in:
pradeepkumar
2026-04-15 19:07:27 +05:30
parent cf2e62801c
commit fc0e34293e

View File

@@ -8,12 +8,10 @@ interface ExperienceSectionProps {
experience: ExperienceData; experience: ExperienceData;
} }
const INITIAL_DISPLAY_COUNT = 6;
const EXPERTISE_INITIAL_COUNT = 4; const EXPERTISE_INITIAL_COUNT = 4;
const CERTIFICATIONS_INITIAL_COUNT = 2; const CERTIFICATIONS_INITIAL_COUNT = 2;
export function ExperienceSection({ experience }: ExperienceSectionProps) { export function ExperienceSection({ experience }: ExperienceSectionProps) {
const [showAllLicensing, setShowAllLicensing] = useState(false);
const [showAllExpertise, setShowAllExpertise] = useState(false); const [showAllExpertise, setShowAllExpertise] = useState(false);
const [showAllCertifications, setShowAllCertifications] = useState(false); const [showAllCertifications, setShowAllCertifications] = useState(false);
@@ -21,14 +19,10 @@ export function ExperienceSection({ experience }: ExperienceSectionProps) {
const hasAgency = !!(experience.agencyName || experience.agencyDesignation); const hasAgency = !!(experience.agencyName || experience.agencyDesignation);
// Calculate how many more items are hidden // Calculate how many more items are hidden
const licensingRemaining = experience.licensingAreas.length - INITIAL_DISPLAY_COUNT;
const expertiseRemaining = experience.expertiseYears.length - EXPERTISE_INITIAL_COUNT; const expertiseRemaining = experience.expertiseYears.length - EXPERTISE_INITIAL_COUNT;
const certificationsRemaining = experience.certifications.length - CERTIFICATIONS_INITIAL_COUNT; const certificationsRemaining = experience.certifications.length - CERTIFICATIONS_INITIAL_COUNT;
// Get displayed items // Get displayed items
const displayedLicensing = showAllLicensing
? experience.licensingAreas
: experience.licensingAreas.slice(0, INITIAL_DISPLAY_COUNT);
const displayedExpertise = showAllExpertise const displayedExpertise = showAllExpertise
? experience.expertiseYears ? experience.expertiseYears
: experience.expertiseYears.slice(0, EXPERTISE_INITIAL_COUNT); : experience.expertiseYears.slice(0, EXPERTISE_INITIAL_COUNT);