Improve search functionality to include video titles and descriptions
Update FolxStadlPage to filter videos by title and description based on search query, enhancing search relevance. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ab9cd02a-d0b2-4288-9ceb-1964d0059648 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/ab9cd02a-d0b2-4288-9ceb-1964d0059648/Uw7sw4i
This commit is contained in:
parent
4297267681
commit
a34fc28345
@ -27,10 +27,19 @@ export default function FolxStadlPage() {
|
|||||||
const videos = data?.videos || [];
|
const videos = data?.videos || [];
|
||||||
|
|
||||||
// Filter all FOLX STADL videos (including all seasons and formats)
|
// Filter all FOLX STADL videos (including all seasons and formats)
|
||||||
const folxStadlVideos = videos.filter(video =>
|
let folxStadlVideos = videos.filter(video =>
|
||||||
video.title.includes("FOLX STADL") || video.title.includes("FOLXSTADL")
|
video.title.includes("FOLX STADL") || video.title.includes("FOLXSTADL")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Apply search filter if search query exists
|
||||||
|
if (searchQuery && searchQuery.length >= 2) {
|
||||||
|
const searchLower = searchQuery.toLowerCase();
|
||||||
|
folxStadlVideos = folxStadlVideos.filter(video =>
|
||||||
|
video.title.toLowerCase().includes(searchLower) ||
|
||||||
|
video.description?.toLowerCase().includes(searchLower)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Pagination logic
|
// Pagination logic
|
||||||
const totalPages = Math.ceil(folxStadlVideos.length / itemsPerPage);
|
const totalPages = Math.ceil(folxStadlVideos.length / itemsPerPage);
|
||||||
const startIndex = (currentPage - 1) * itemsPerPage;
|
const startIndex = (currentPage - 1) * itemsPerPage;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user