-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpenseList.js
More file actions
27 lines (24 loc) · 815 Bytes
/
ExpenseList.js
File metadata and controls
27 lines (24 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React, { useContext } from 'react';
import ExpenseItem from './ExpenseItem';
import { AppContext } from '../context/AppContext';
const ExpenseList = () => {
const { expenses } = useContext(AppContext);
return (
<table className='table'>
<thead className="thead-light">
<tr>
<th scope="col">Department</th>
<th scope="col">Allocated Budget</th>
<th scope="col">Increase by 10</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
{expenses.map((expense) => (
<ExpenseItem id={expense.id} key={expense.id} name={expense.name} cost={expense.cost} />
))}
</tbody>
</table>
);
};
export default ExpenseList;