import { useState, useEffect } from 'react'; import { GlassSurface, Button, Input, SearchBar, StatCard, Modal } from './ui'; import AdminCatalogFilters from './AdminCatalogFilters'; import AdminCatalogTable from './AdminCatalogTable'; import AdminCatalogPagination from './AdminCatalogPagination'; export default function AdminCatalogView(props) { const { cards, loading, loadingMore, searchQuery, selectedGame, selectedRarity, selectedSet, minPrice, maxPrice, verifiedOnly, sortColumn, sortDirection, pagination, filters, hasMore, error, handleSearchChange, handleGameChange, handleRarityChange, handleSetChange, handleMinPriceChange, handleMaxPriceChange, handleVerifiedChange, handleSort, handleLoadMore, handleRefresh, handleLimitChange } = props; const [showFilters, setShowFilters] = useState(true); const cardCount = cards.length; const totalCount = pagination.total; useEffect(() => { const handleScroll = () => { if ( window.innerHeight + document.documentElement.scrollTop >= document.documentElement.offsetHeight - 1000 ) { handleLoadMore(); } }; window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); }, [handleLoadMore, hasMore, loadingMore]); return (
Admin view: {totalCount.toLocaleString()} cards total · showing {cardCount.toLocaleString()}