import React from 'react' import { useNavigate } from 'react-router-dom' import { Heart, MessageCircle, Eye, Lock } from 'lucide-react' import { Story } from '../../types' import { useAuthStore } from '../../store/authStore' import { StatusBadge, GenreBadge } from './Badge' import { getGenreGradient } from '../story/GenreBadge' interface StoryCardProps { story: Story showStatus?: boolean } export const StoryCard: React.FC = ({ story, showStatus = false }) => { const navigate = useNavigate() const { currentUser, showMatureContent } = useAuthStore() const isMature = story.mature_content const isGuest = !currentUser const blurContent = isMature && isGuest && !showMatureContent const primaryGenre = story.genres[0] || 'Fantasy' const gradient = getGenreGradient(primaryGenre) return (
navigate(`/story/${story.story_id}`)} > {/* Cover */}
{/* Mature ribbon */} {isMature && (
18+
)} {/* Status badge */} {showStatus && (
)} {/* Blur overlay for mature on guest */} {blurContent && (

Mature Content

Login to view

)} {/* Genre decorative circles */}
{/* Content */}

{story.title}

by {story.author_username}

{story.short_description}

{/* Genre badges */}
{story.genres.slice(0, 2).map(g => ( ))} {story.genres.length > 2 && ( +{story.genres.length - 2} )}
{/* Stats */}
{story.total_likes.toLocaleString()} {story.total_comments} {story.total_views.toLocaleString()}
) }