import React from 'react' import { useNavigate } from 'react-router-dom' import { Feather, Star, BookOpen, Users, Sparkles, ArrowRight, ChevronRight } from 'lucide-react' import logo from '../assets/chapterX-removebg-preview.png' import { useStoryStore } from '../store/storyStore' import { useAuthStore } from '../store/authStore' import { Button } from '../components/ui/Button' import { StoryCard } from '../components/ui/StoryCard' import { GenreBadge } from '../components/ui/Badge' const features = [ { icon: , title: 'Read & Discover', desc: 'Explore thousands of stories across every genre. From fantasy epics to contemporary fiction.' }, { icon: , title: 'Write & Publish', desc: 'Share your stories with a passionate community. Get feedback, likes, and readers from day one.' }, { icon: , title: 'Collaborate', desc: 'Invite co-authors, editors, and beta readers. Build stories together with real-time collaboration.' }, { icon: , title: 'AI Assistance', desc: 'Get intelligent writing suggestions for grammar, style, plot, and pacing to improve your craft.' }, ] const genres = ['Fantasy', 'Sci-Fi', 'Romance', 'Historical Fiction', 'Adventure', 'Thriller', 'Mystery', 'Horror'] export const LandingPage: React.FC = () => { const navigate = useNavigate() const { stories } = useStoryStore() const { currentUser } = useAuthStore() const trending = stories.filter(s => s.status === 'published').slice(0, 4) return (
{/* Hero */}
The collaborative storytelling platform
ChapterX

Write Your Own Story.
Anyone Could Be Shakespeare.

ChapterX is where writers and readers connect. Publish your stories, collaborate with others, and discover your next great read.

{currentUser ? ( <> {(currentUser.role === 'writer' || currentUser.role === 'admin') && ( )} ) : ( <> )}
{/* Features */}

Everything You Need

A complete platform for creative writing and reading.

{features.map(f => (
{f.icon}

{f.title}

{f.desc}

))}
{/* Genres */}

Explore Genres

{genres.map(g => ( ))}
{/* Trending stories */}

Trending Stories

Most popular right now

{trending.map(story => ( ))}
{/* CTA */} {!currentUser && (

Ready to Begin Your Story?

Join thousands of writers and readers on ChapterX today.

)}
) }