'use client' import { useState, useEffect } from 'react' import { ArrowRight, Loader2 } from 'lucide-react' import { Button } from '@/components/ui/button' import { api } from '@/lib/api' const staticProjects = [ { title: 'AgriTech Nepal', description: 'Smart agricultural solutions connecting farmers with modern technology to improve crop yield and reduce costs', image: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)', tags: ['Agriculture', 'IoT', 'Data Analytics'], contributors: 12, }, { title: 'WDUBot', description: 'An intelligent bot platform for Nepali universities providing academic support and administrative assistance', image: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)', tags: ['AI', 'Education', 'Chatbot'], contributors: 8, }, { title: 'HealthLink', description: 'Connecting patients with healthcare providers in remote areas of Nepal through telemedicine platform', image: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)', tags: ['Healthcare', 'Telemedicine', 'Web'], contributors: 15, }, ] export function FeaturedProjects() { const [projects, setProjects] = useState([]) const [loading, setLoading] = useState(true) useEffect(() => { const loadProjects = async () => { try { const data = await api.projects.list() if (data && data.length > 0) { setProjects(data) } else { setProjects(staticProjects) } } catch (error) { console.error('Failed to fetch projects:', error) setProjects(staticProjects) } finally { setLoading(false) } } loadProjects() }, []) return ( ) }