Update Usage.tsx

This commit is contained in:
alorig
2025-11-09 17:16:58 +05:00
parent e3ff5b9963
commit 30623b8f17

View File

@@ -11,17 +11,16 @@ export default function Usage() {
const [limits, setLimits] = useState<LimitCard[]>([]); const [limits, setLimits] = useState<LimitCard[]>([]);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [limitsLoading, setLimitsLoading] = useState(true); const [limitsLoading, setLimitsLoading] = useState(true);
const [currentPage, setCurrentPage] = useState(1);
useEffect(() => { useEffect(() => {
loadUsage(); loadUsage();
loadLimits(); loadLimits();
}, [currentPage]); }, []);
const loadUsage = async () => { const loadUsage = async () => {
try { try {
setLoading(true); setLoading(true);
const response = await fetchCreditUsage({ page: currentPage }); const response = await fetchCreditUsage({ page: 1 });
setUsageLogs(response.results || []); setUsageLogs(response.results || []);
} catch (error: any) { } catch (error: any) {
toast.error(`Failed to load usage logs: ${error.message}`); toast.error(`Failed to load usage logs: ${error.message}`);