source: frontend/src/Components/RestaurantDetails/TablesTable.js@ 0f5aa27

Last change on this file since 0f5aa27 was 07f4e8b, checked in by darsov2 <62809499+darsov2@…>, 5 months ago

prefinal fixes

  • Property mode set to 100644
File size: 1.4 KB
Line 
1import React from "react";
2import Form from "react-bootstrap/Form";
3import FaHotel from "react-icons/fa";
4import {Button} from "react-bootstrap";
5import useCreate from "../Hooks/useCreate";
6import TableRow from "./TableRow";
7
8const TablesTable = (props) => {
9
10 console.log(props)
11
12
13 return (
14 <>
15 <table className="m-auto table table-hover table-responsive">
16 <thead>
17 <tr>
18 <th scope="col">Тип на маса</th>
19 <th scope="col">Колку единици?</th>
20 <th scope="col"></th>
21 </tr>
22 </thead>
23 <tbody>
24 {Array.from(
25 new Set(props.data.map((x) => JSON.stringify(x.restaurantTable)))
26 ).map((roomString) => JSON.parse(roomString)).map((table) => {
27 return (
28 <>
29 <TableRow
30 params={props.params}
31 availableId={props.data.filter(x => x.restaurantTable.tableId === table.tableId).
32 map(x => x.restaurantAvailibleId)[0]}
33 data={props.data} table={table} from={props.from} to={props.to}/>
34 </>
35 );
36 })}
37 </tbody>
38 </table>
39 </>
40 );
41};
42
43export default TablesTable;
Note: See TracBrowser for help on using the repository browser.