diff --git a/src/components/user/ProjectSection.tsx b/src/components/user/ProjectSection.tsx
index efe7f7c..9e22b21 100644
--- a/src/components/user/ProjectSection.tsx
+++ b/src/components/user/ProjectSection.tsx
@@ -1,26 +1,27 @@
import { useEffect, useState } from 'react';
-import { Calendar, GitBranch, ExternalLink } from 'lucide-react';
+import { Calendar, GitBranch, ExternalLink, Package, Monitor, Smartphone, Cpu } from 'lucide-react';
import { Button } from '../ui/button';
import { formatDate } from '@/utils/formatdate.utils';
import { getAllProjects } from '@/services/admin/projectServices';
+import type { Contributor, ProjectResponse, Tag } from '@/types/project.types';
const FILTERS = [
- { label: 'All Projects', tag: 'all', icon: '📦' },
- { label: 'Web', tag: 'Web', icon: '🖥️' },
- { label: 'Mobile', tag: 'Mobile', icon: '📱' },
- { label: 'AI/ML', tag: 'AI/ML', icon: '🤖' },
+ { label: 'All Projects', tag: 'all', icon:
},
+ { label: 'Web', tag: 'Web', icon:
},
+ { label: 'Mobile', tag: 'Mobile', icon:
},
+ { label: 'AI/ML', tag: 'AI/ML', icon:
},
];
const ProjectSection: React.FC = () => {
- const [projects, setProjects] = useState([]);
- const [loading, setLoading] = useState(true);
- const [error, setError] = useState('');
- const [activeFilter, setActiveFilter] = useState('all');
+ const [projects, setProjects] = useState
([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState('');
+ const [activeFilter, setActiveFilter] = useState('all');
useEffect(() => {
const fetchProjects = async () => {
try {
- const projectsData = await getAllProjects();
+ const projectsData: ProjectResponse[] = await getAllProjects();
setProjects(projectsData || []);
} catch (err: any) {
setError(err.message || 'Something went wrong');
@@ -34,60 +35,60 @@ const ProjectSection: React.FC = () => {
if (loading) return Loading projects...
;
if (error) return {error}
;
- const filteredProjects =
+ const filteredProjects: ProjectResponse[] =
activeFilter === 'all'
? projects
- : projects.filter((project) => (project.tags || []).some((tag) => tag.name === activeFilter));
+ : projects.filter((project: ProjectResponse) =>
+ (project.tags || []).some((tag: Tag | string) =>
+ typeof tag === 'string' ? tag === activeFilter : tag.name === activeFilter
+ )
+ );
return (
-
- Projects
-
+ Projects
-
- Built by the community
-
+
Built by the community
{/* Filter Buttons */}
-
- {FILTERS.map((filter, idx) => (
-
- ))}
-
+
+ {FILTERS.map((filter, idx) => (
+
+ ))}
+
+
{/* Projects Grid */}
- {filteredProjects.map((project) => (
+ {filteredProjects.map((project: ProjectResponse) => (
-
+ {/* Image */}
+
{project.thumbnailUrl ? (

) : (
-
+
No Image
)}
@@ -100,7 +101,7 @@ const ProjectSection: React.FC = () => {
{/* Tech Stack */}
- {(project.techStacks || []).map((tech, idx) => (
+ {(project.techStacks || []).map((tech: string, idx: number) => (
{
{formatDate(project.createdAt)}
- {/* Contributors*/}
+ {/* Contributors (hex masked, overlapping) */}
- {(project.contributors || []).slice(0, 3).map((c) => (
+ {(project.contributors || []).slice(0, 3).map((c: Contributor) => (
{
- What's happening
+ What's Happening
-
- Industry-grade events, workshops, and summits designed to push your skills forward.
-
-
+
{/* Left Image */}
![]()
{
return (
-