diff --git a/src/components/profile/ProjectShowcaseSection.tsx b/src/components/profile/ProjectShowcaseSection.tsx index 370358ee..2cc71d35 100644 --- a/src/components/profile/ProjectShowcaseSection.tsx +++ b/src/components/profile/ProjectShowcaseSection.tsx @@ -1,6 +1,7 @@ // src/components/profile/ProjectShowcaseSection.tsx 'use client'; +import { useState } from 'react'; import { ExternalLink, Github } from 'lucide-react'; import type { PortfolioProject } from '@/types/portfolio'; @@ -8,9 +9,16 @@ interface Props { projects: PortfolioProject[]; } +const ITEMS_PER_PAGE = 6; + export function ProjectShowcaseSection({ projects }: Props) { + const [visibleCount, setVisibleCount] = useState(ITEMS_PER_PAGE); + if (!projects?.length) return null; + const visibleProjects = projects.slice(0, visibleCount); + const hasMore = visibleCount < projects.length; + return (
@@ -22,10 +30,24 @@ export function ProjectShowcaseSection({ projects }: Props) {
- {projects.map((project) => ( + {visibleProjects.map((project) => ( ))}
+ {hasMore && ( +
+ +
+ )}
); }