import { MemeCard } from '@/components/custom/meme-card'; import { Badge } from '@/components/ui/badge'; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from '@/components/ui/breadcrumb'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; import { KeywordBadge } from '@/components/ui/keyword-badge'; import Footer from '@/pages/home/partials/Footer'; import { Link, router } from '@inertiajs/react'; import { Search } from 'lucide-react'; import { useState } from 'react'; import { route } from 'ziggy-js'; import BrandLogo from '../home/partials/BrandLogo'; interface MemeMedia { ids: string; name: string; description: string; keywords: string[]; action_keywords: string[]; emotion_keywords: string[]; misc_keywords: string[]; mov_url: string; webm_url: string; gif_url: string; webp_url: string; slug: string; } interface CursorPaginatedMemes { data: MemeMedia[]; next_cursor: string | null; prev_cursor: string | null; next_page_url: string | null; prev_page_url: string | null; per_page: number; path: string; } interface Props { memes: CursorPaginatedMemes; types: string[]; popularKeywords: string[]; filters: { search?: string; }; dynamicDescription?: string; } export default function MemesIndex({ memes, popularKeywords, filters, dynamicDescription }: Props) { const [search, setSearch] = useState(filters.search || ''); const handleSearch = (e: React.FormEvent) => { e.preventDefault(); navigateToSearch(search); }; const handleKeywordClick = (keyword: string) => { setSearch(keyword); navigateToSearch(keyword); }; const navigateToSearch = (searchTerm: string) => { if (!searchTerm.trim()) { router.get(route('memes.index')); return; } const trimmedSearch = searchTerm.trim(); // Convert spaces to + for URL segment const urlSegment = trimmedSearch.replace(/\s+/g, '+'); router.get(route('memes.search', urlSegment)); }; return ( <>
{filters.search ? dynamicDescription || `Discover ${filters.search} meme templates and create viral content for TikTok, Instagram Reels, and YouTube Shorts.` : 'Thousands of memes ready for TikTok, Reels, Threads and YouTube Shorts. No signup needed - click any meme to start creating!'}
Request it in our Discord community and we'll add it to the library!