'use client' import { useEffect } from 'react' import { useRouter } from 'next/navigation' import useAuthStore from '../store/authStore' import Header from '../components/nav/Header' import Footer from '../components/Footer' import { UsersIcon, ChatBubbleLeftRightIcon, HeartIcon, FireIcon, TrophyIcon, UserGroupIcon, PlusIcon, ArrowRightIcon } from '@heroicons/react/24/outline' export default function CommunityPage() { const router = useRouter() const user = useAuthStore(state => state.user) // Redirect if not logged in useEffect(() => { if (!user) { router.push('/login') } }, [user, router]) // Don't render if no user if (!user) { return (

Loading...

) } // Mock community data const communityStats = [ { label: 'Members', value: '12,487', icon: UsersIcon, color: 'text-blue-600' }, { label: 'Active Groups', value: '156', icon: UserGroupIcon, color: 'text-green-600' }, { label: 'Discussions', value: '3,421', icon: ChatBubbleLeftRightIcon, color: 'text-purple-600' }, { label: 'Daily Active', value: '2,186', icon: FireIcon, color: 'text-orange-600' } ] const trendingGroups = [ { name: 'Eco Warriors', members: '1,284', category: 'Sustainability', image: '🌱', description: 'Join fellow eco-enthusiasts in making the world greener' }, { name: 'Zero Waste Living', members: '892', category: 'Lifestyle', image: '♻️', description: 'Tips and tricks for living a zero-waste lifestyle' }, { name: 'Sustainable Fashion', members: '756', category: 'Fashion', image: '👕', description: 'Ethical fashion choices and sustainable brands' }, { name: 'Green Tech', members: '634', category: 'Technology', image: '💚', description: 'Discuss the latest in green technology and innovation' } ] const recentPosts = [ { user: 'Sarah M.', group: 'Eco Warriors', time: '2 hours ago', content: 'Just discovered a fantastic new way to upcycle old furniture! Has anyone tried painting with eco-friendly paints?', likes: 23, comments: 8 }, { user: 'David K.', group: 'Zero Waste Living', time: '4 hours ago', content: 'Week 3 of my zero-waste challenge! Managed to produce only 1 small jar of waste. Here are my top tips...', likes: 45, comments: 12 }, { user: 'Maria L.', group: 'Sustainable Fashion', time: '6 hours ago', content: 'Found an amazing local brand that makes clothes from recycled ocean plastic. Their quality is incredible!', likes: 38, comments: 15 } ] return (
{/* Header Section */}

Welcome to Profit Planet Community 🌍

Connect with like-minded individuals, share sustainable practices, and make a positive impact together.

{/* Community Stats */}
{communityStats.map((stat, index) => (

{stat.value}

{stat.label}

))}
{/* Main Content */}
{/* Trending Groups */}

Trending Groups

{trendingGroups.map((group, index) => (
{group.image}

{group.name}

{group.category}

{group.description}

{group.members} members

))}
{/* Recent Discussions */}

Recent Discussions

{recentPosts.map((post, index) => (
{post.user.charAt(0)}
{post.user} {post.group} {post.time}

{post.content}

))}
{/* Sidebar */}
{/* Quick Actions */}

Quick Actions

{/* My Groups */}

My Groups

🌱

Eco Warriors

1,284 members

♻️

Zero Waste Living

892 members

{/* Community Guidelines */}

Community Guidelines

  • • Be respectful and kind
  • • Stay on topic
  • • Share authentic experiences
  • • Help others learn and grow
) }