'use client'; import { Button, Card, CardContent, CardHeader, CardTitle } from '@components'; import { AnimatePresence, motion } from 'framer-motion'; import { useState } from 'react'; import { BiUpvote } from 'react-icons/bi'; import { FiCheckCircle } from 'react-icons/fi'; import { MdOutlineOpenInNew } from 'react-icons/md'; export default function ProjectsVote() { const [upcomingItems, setUpcomingItems] = useState([ { title: 'IMPHNEN Project Showcase', description: 'Showcase projectmu ke member lain dan dapatkan feedback', votes: 42, voted: false, }, { title: 'IMPHNEN Meme Generator', description: 'Bikin meme kocak kapanpun dengan mudah', votes: 42, voted: false, }, ]); const inProgressItems = [ { title: 'IMPHNEN Twibbon', description: 'Buat Twibbon kece untuk profile media sosialmu', }, { title: 'IMPHNEN Certificate', description: 'Cetak sertifikat keren secara instan untuk anggota IMPHNEN', }, ]; const completedItems = [ { title: 'IMPHNEN List Event', description: 'Koleksi daftar event dan kolaborasi seru yang bisa kamu ikuti', }, { title: 'IMPHNEN Testimoni', description: 'Berikan testimonial gokil buat komunitas IMPHNEN', }, { title: 'IMPHNEN Roadmap by Vote', description: 'Usulkan ide fitur seru dan ajak anggota lain buat voting', }, ]; const handleVote = (index: number) => { const newItems = [...upcomingItems]; newItems[index] = { ...newItems[index], votes: newItems[index].voted ? newItems[index].votes - 1 : newItems[index].votes + 1, voted: !newItems[index].voted, }; setUpcomingItems(newItems); }; const containerVariants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.05, }, }, }; const itemVariants = { hidden: { opacity: 0, y: 10 }, visible: { opacity: 1, y: 0, transition: { duration: 0.2 } }, }; return (
{/* Vote Now Column */}
🔥

Vote Now

{upcomingItems.map((item, index) => ( {item.title}

{item.description}

handleVote(index)} className={`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all ${ item.voted ? 'bg-primary-500 text-white hover:bg-primary-600' : 'bg-gray-100 text-gray-700 hover:bg-gray-200' }`} > {item.voted ? 'Voted' : 'Vote'}
{item.votes}
))}
{/* In Progress Column */}
🧑‍🔧

In Progress

{inProgressItems.map((item, index) => ( {item.title}

{item.description}

{index === 0 ? 'Development started' : 'In development'}

))}
{/* Completed Column */}
🤓

Completed

{completedItems.map((item, index) => ( {item.title}

{item.description}

Implemented
))}
); }