Blog Components
Components for displaying and managing blog content, including listing, filtering, and individual post views.BlogList Component
The main blog listing page with search and filtering capabilities.Import
Usage
State Management
Controls mobile navigation menu visibility
Current search query for filtering posts
Currently selected category filter
Currently selected tag filter
Filtering Logic
Posts are filtered using memoized computation:Features
Full-text search across titles, excerpts, categories, and tags
- Glass morphism design (backdrop-blur)
- Focus states with orange accent
- Search icon from lucide-react
Category and tag filtering using FilterDropdown component
- Dynamic options generated from available posts
- Mobile-responsive layout (flex-col on mobile, flex-row on desktop)
Visual badges showing currently active filters with clear all option
Separate grid for featured blog posts (md:grid-cols-2)
Standard grid layout (md:grid-cols-2, lg:grid-cols-3)
Source Location
src/app/BlogList.tsx:11
BlogPost Component
Individual blog post page with full content, metadata, and AI summarization.Import
Usage
State Management
Mobile navigation toggle state
Tracks if share link has been copied to clipboard
Controls ChatBox visibility for AI summarization
Blog context passed to ChatBox for AI summarization
View Tracking
Uses Convex for real-time view counting:Actions
Shares the blog post using Web Share API or copies URL to clipboard
Opens ChatBox with blog context for AI summarization
Metadata Display
Gradient badge with category name
Formatted date with Calendar icon
Estimated reading time with Clock icon
Real-time view count with Eye icon
Clickable tag badges that link to filtered blog list
Markdown Rendering
Custom ReactMarkdown components for styled content:Source Location
src/app/BlogPost.tsx:15
Data Flow
Both components rely on blog utility functions:getAllBlogPosts()- Fetches all blog metadatagetBlogPost(slug)- Fetches individual post with contentsearchPosts()- Filters posts by search queryfilterByCategory()- Filters by categoryfilterByTag()- Filters by taggetAllCategories()- Gets unique categoriesgetAllTags()- Gets unique tagsformatDate()- Formats date strings
Dependencies
react-router-dom- URL routing and navigationreact-markdown- Markdown content renderingconvex/react- Real-time database hookslucide-react- UI icons- Custom blog utilities and types