Zobrazení celkové ceny za Pizza day
This commit is contained in:
@@ -12,6 +12,8 @@ export default function PizzaOrderList({ state, orders, onDelete }: { state: Sta
|
||||
return <p className="mt-3"><i>Zatím žádné objednávky...</i></p>
|
||||
}
|
||||
|
||||
const total = orders.map(order => order.pizzaList.map(o => o.price).reduce((total, i) => total + i)).reduce((total, i) => total + i);
|
||||
|
||||
return <Table className="mt-3" striped bordered hover>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -38,6 +40,10 @@ export default function PizzaOrderList({ state, orders, onDelete }: { state: Sta
|
||||
<td>{order.note || '-'}</td>
|
||||
<td>{order.totalPrice} Kč</td>
|
||||
</tr>)}
|
||||
<tr style={{ fontWeight: 'bold' }}>
|
||||
<td colSpan={3}>Celkem</td>
|
||||
<td>{`${total} Kč`}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</Table>
|
||||
}
|
||||
Reference in New Issue
Block a user