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 { const response = await fetchExpenses(); setexpensesData(response.results); } catch (error) { console.error('Error fetching sales 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