source: frontend/src/Components/AdminPanel/UnapprovedBusinessesTable.js@ 07f4e8b

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

images upload/download impl, other fixes

  • Property mode set to 100644
File size: 2.1 KB
Line 
1import useGet from "../Hooks/useGet";
2import {Container} from "react-bootstrap";
3import {FaCheckCircle} from "react-icons/fa";
4import React from "react";
5import useApprove from "../Hooks/useApprove";
6
7const UnapprovedBusinessesTable = () => {
8
9 const { data, isLoading, setData, getData, setChanged } = useGet('/business/unapproved');
10 const { getData: approveBusiness} = useApprove();
11
12 return (
13 <>
14 <Container fluid >
15 <table className="table table-hover">
16 <thead>
17 <tr>
18 <th scope="col">Ред. бр.</th>
19 <th scope="col">Име на фирма</th>
20 <th scope="col">Адреса</th>
21 <th scope="col">Даночен број</th>
22 <th scope="col">Одговорно лице</th>
23 <th>Одобри</th>
24 </tr>
25 </thead>
26 <tbody>
27 {!isLoading && data.map((f, i) => { return <tr key={f.businessId}>
28 <th style={{verticalAlign: "middle"}} scope="row">{i + 1}</th>
29 <td style={{verticalAlign: "middle"}}>{f.name}</td>
30 <td style={{verticalAlign: "middle"}}>{f.address}</td>
31 <td style={{verticalAlign: "middle"}}>{f.edbs}</td>
32 <td style={{verticalAlign: "middle"}}>{f.user.name + " " + f.user.surname}</td>
33 <td style={{verticalAlign: "middle"}}><FaCheckCircle size={'2.2em'} color={'#159895'} onClick={() => {
34 approveBusiness('/business/approve/' + f.businessId).then(() => {
35 setChanged((prev) => {
36 return Math.random();
37 })
38 })
39 }}/></td>
40 </tr>})}
41 </tbody>
42 </table>
43 </Container>
44 </>
45 )
46}
47
48export default UnapprovedBusinessesTable;
Note: See TracBrowser for help on using the repository browser.