Create New Post
{post.title}
{post.type === 'event' && ({post.description}
{isAdmin && ( )}import { useState } from 'react'; import { Calendar, Clock, Image, Video, Newspaper, Plus, X, ChevronRight } from 'lucide-react'; export default function CheckersApp() { const [isAdmin, setIsAdmin] = useState(true); // Toggle for demo purposes const [activeTab, setActiveTab] = useState('events'); const [posts, setPosts] = useState([ { id: 1, type: 'event', title: 'Annual Community Gathering', date: '2024-02-20', time: '14:00', description: 'Join us for our annual community gathering with food and entertainment.', image: 'https://images.unsplash.com/photo-1511578314322-379afb476865' }, { id: 2, type: 'news', title: 'New Community Center Opening', date: '2024-02-15', description: 'We are excited to announce the opening of our new community center.', image: 'https://images.unsplash.com/photo-1486406146926-c627a92ad1ab' } ]); const [newPost, setNewPost] = useState({ title: '', date: '', time: '', description: '', image: '', video: '', type: 'event' }); const handleSubmit = (e) => { e.preventDefault(); setPosts([...posts, { ...newPost, id: posts.length + 1 }]); setNewPost({ title: '', date: '', time: '', description: '', image: '', video: '', type: 'event' }); }; return (
{post.description}
{isAdmin && ( )}