import React, { useState, useMemo } from ‘react’;
import { EBOOKS } from ‘./constants’;
import { Book, Category } from ‘./types’;
import { BookCard } from ‘./components/BookCard’;
import { FunnelSection } from ‘./components/FunnelSection’;
const App: React.FC = () => {
const [selectedCategory, setSelectedCategory] = useState
const [selectedAuthor, setSelectedAuthor] = useState
const [searchQuery, setSearchQuery] = useState
const [activeBook, setActiveBook] = useState
// Derive unique authors for filter
const authors = useMemo(() => {
const list = Array.from(new Set(EBOOKS.map(b => b.author)));
return [‘All’, …list];
}, []);
const filteredBooks = useMemo(() => {
return EBOOKS.filter(book => {
const matchesCategory = selectedCategory === ‘All’ || book.category === selectedCategory;
const matchesAuthor = selectedAuthor === ‘All’ || book.author === selectedAuthor;
const search = searchQuery.toLowerCase();
const matchesSearch =
book.title.toLowerCase().includes(search) ||
book.description.toLowerCase().includes(search) ||
book.author.toLowerCase().includes(search) ||
book.category.toLowerCase().includes(search);
return matchesCategory && matchesAuthor && matchesSearch;
});
}, [selectedCategory, selectedAuthor, searchQuery]);
return (
{/* Hero Section */}
Ancient Biblical Wisdom for Modern Times
Inspiring Success through Faith
Discover a curated library dedicated to spiritual growth, church revitalization, and the art of biblical salesmanship.
New Release
Available Today
{/* Book Gallery Section */}
The Digital Shelf
Filter by genre or search keywords to find the exact wisdom your mission requires.
{/* Advanced Filter Bar */}
setSearchQuery(e.target.value)}
className=”block w-full pl-11 pr-4 py-4 bg-white border border-slate-200 rounded-2xl focus:ring-2 focus:ring-brand-neon focus:border-transparent transition-all outline-none text-slate-900 font-medium”
/>
{/* Author Filter */}
{/* Reset Button */}
{/* Genre Filter Chips */}
{[‘All’, …Object.values(Category)].map((cat) => (
))}
{/* Results Summary */}
Showing {filteredBooks.length} eBooks
{searchQuery && for “{searchQuery}“}
{/* Gallery Grid */}
))}
{filteredBooks.length === 0 && (
No match found
We couldn’t find any books matching your current search criteria. Try broadening your filters.
)}
{/* Funnel Modal */}
{activeBook && (
/>
)}
{/* Footer (Condensed for space) */}
);
};
export default App;