diff --git a/app/[locale]/(public)/content/audio/page.tsx b/app/[locale]/(public)/content/audio/page.tsx index b228ded..cdabfed 100644 --- a/app/[locale]/(public)/content/audio/page.tsx +++ b/app/[locale]/(public)/content/audio/page.tsx @@ -6,7 +6,14 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Card } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; -import { ThumbsUp, ThumbsDown, Search, Filter, Calendar, Tag } from "lucide-react"; +import { + ThumbsUp, + ThumbsDown, + Search, + Filter, + Calendar, + Tag, +} from "lucide-react"; import Link from "next/link"; import { useRouter, useSearchParams } from "next/navigation"; import { listArticles } from "@/service/landing/landing"; @@ -71,7 +78,7 @@ export default function ArticleListPage() { const [currentPage, setCurrentPage] = useState(1); const [totalPages, setTotalPages] = useState(1); const [totalData, setTotalData] = useState(0); - + const router = useRouter(); const searchParams = useSearchParams(); const MySwal = withReactContent(Swal); @@ -86,7 +93,14 @@ export default function ArticleListPage() { // Load articles when filters change useEffect(() => { loadArticles(); - }, [currentPage, selectedCategory, selectedType, searchTerm, startDate, endDate]); + }, [ + currentPage, + selectedCategory, + selectedType, + searchTerm, + startDate, + endDate, + ]); // Sync bookmarks useEffect(() => { @@ -107,10 +121,12 @@ export default function ArticleListPage() { async function loadArticles() { try { setLoading(true); - - const categoryId = selectedCategory === "all" ? undefined : selectedCategory; - const typeId = selectedType === "all" ? undefined : parseInt(selectedType); - + + const categoryId = + selectedCategory === "all" ? undefined : selectedCategory; + const typeId = + selectedType === "all" ? undefined : parseInt(selectedType); + const response = await listArticles( currentPage, itemsPerPage, @@ -235,11 +251,16 @@ export default function ArticleListPage() { const getTypeLabel = (typeId: number) => { switch (typeId) { - case 1: return "📸 Image"; - case 2: return "🎬 Video"; - case 3: return "📝 Text"; - case 4: return "🎵 Audio"; - default: return "📄 Content"; + case 1: + return "📸 Image"; + case 2: + return "🎬 Video"; + case 3: + return "📝 Text"; + case 4: + return "🎵 Audio"; + default: + return "📄 Content"; } }; @@ -258,7 +279,9 @@ export default function ArticleListPage() { {/* Search */}
- +
- + - +