Skip to content

Commit 61b33dc

Browse files
committed
refactor: improve ProjectCard type safety and component API
- Use Project type from content for ProjectCardProps - Remove default projects prop from FeaturedProjects - Add optional chaining for projects prop - Update tests to handle new component API - Simplify mock implementations
1 parent 863f280 commit 61b33dc

8 files changed

Lines changed: 136 additions & 731 deletions

File tree

src/components/sections/FeaturedProjects.tsx

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,13 @@
33
import { motion } from 'framer-motion';
44
import { ProjectCard } from '@/components/ui';
55
import { projectStaggerVariants } from '@/lib';
6-
7-
// Default project data
8-
const defaultProjects = [
9-
{
10-
title: "CCPTools Ecosystem",
11-
description: "Microservices platform focused on construction cost planning and scalability. Features real-time calculations, mobile apps, and scalable backend architecture.",
12-
technologies: ["React Native", "Node.js", "PostgreSQL", "Docker", "Redis"]
13-
},
14-
{
15-
title: "Nutrition Management Platform",
16-
description: "Multi-tenant SaaS platform focused on scalable nutrition tracking with tenant isolation. Features real-time tracking, analytics, and production-ready architecture.",
17-
technologies: ["React", "NestJS", "PostgreSQL", "Redis", "TypeScript"]
18-
},
19-
{
20-
title: "Healthcare Management System",
21-
description: "HIPAA-Compliant Platform focused on patient management and compliance. Features HIPAA compliance, real-time monitoring, secure auth, and case study available.",
22-
technologies: ["Next.js", "Express", "MongoDB", "AWS", "TypeScript"]
23-
}
24-
];
25-
26-
export interface Project {
27-
title: string;
28-
description: string;
29-
technologies: string[];
30-
}
6+
import { type Project } from '@/content';
317

328
export interface FeaturedProjectsProps {
339
projects?: Project[];
3410
}
3511

36-
export function FeaturedProjects({ projects = defaultProjects }: FeaturedProjectsProps) {
12+
export function FeaturedProjects({ projects }: FeaturedProjectsProps) {
3713
return (
3814
<section
3915
className="py-20 bg-[#ffffff] dark:bg-[#0d1117]"
@@ -55,7 +31,7 @@ export function FeaturedProjects({ projects = defaultProjects }: FeaturedProject
5531
whileInView="visible"
5632
viewport={{ once: true, amount: 0.3 }}
5733
>
58-
{projects.map((project, index) => (
34+
{projects?.map((project, index) => (
5935
<ProjectCard
6036
key={index}
6137
title={project.title}

0 commit comments

Comments
 (0)