import React, { useState, useEffect } from "react"; import { fetchExpenses } from "../../../../APIs/ExpensesApi"; import ExpensesTables from "./ExpensesTables"; const Expenses = () => { const [expensesData, setexpensesData] = useState([]); useEffect(() => { const fetchData = async () => { try { // Set the desired limit value here, for example, 10 const limit = 50; const offset = 0; const response = await fetchExpenses(limit,offset); setexpensesData(response.results); } catch (error) { console.error('Error fetching expenses data:', error); } }; fetchData(); }, []); return ( <> <ExpensesTables expensesData={expensesData} /> </> ); }; export default Expenses
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter