const { useEffect, useState } = React; const { Link } = ReactRouterDOM; function AllHooksPage() { const [hooks, setHooks] = useState([]); const [page, setPage] = useState(1); const [hasMore, setHasMore] = useState(false); const [loading, setLoading] = useState(false); const fetchHooks = async (pageNum, append = false) => { try { setLoading(true); const res = await fetch(`api.php?action=get_hooks&page=${pageNum}&limit=10`); const data = await res.json(); if (data.status === 'success') { if (append) { setHooks(prev => { // Prevent duplicates just in case const existingIds = new Set(prev.map(h => h.id)); const newHooks = data.data.filter(h => !existingIds.has(h.id)); return [...prev, ...newHooks]; }); } else { setHooks(data.data); } setHasMore(data.has_more); } } catch (e) { console.error('Failed to fetch hooks'); } finally { setLoading(false); } }; useEffect(() => { fetchHooks(1, false); }, []); const loadMore = () => { const nextPage = page + 1; setPage(nextPage); fetchHooks(nextPage, true); }; const refreshHooks = () => { // Reset and fetch from beginning setPage(1); fetchHooks(1, false); }; return (

جميع الهاكات

تصفح جميع الهاكات التي تم تحويلها من قبل الزوار والاعضاء.

); }