Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
import {axios} from "../../../utils";
2
import React, { useEffect, useState } from "react";
3
import { useDispatch } from "react-redux";
4
import { addNotification } from "../../../redux/notification/notification.actions";
5
import MaterialTable from "../../../shared/materialTable/MaterialTable";
6
 
7
const BrowserTableColumns = [
8
  {
9
    field: "platform",
10
    headerName: "Plataforma",
11
  },
12
  {
13
    field: "browser",
14
    headerName: "Navegadores",
15
  },
16
  {
17
    field: "device_type",
18
    headerName: "Tipo",
19
  },
20
  {
21
    field: "version",
22
    headerName: "Versión",
23
  },
24
  {
25
    field: "updated_on",
26
    headerName: "Fecha",
27
  },
28
];
29
 
30
const Browsers = ({ routeBrowsers }) => {
31
  const dispatch = useDispatch();
32
 
33
  const [browserData, setBrowserData] = useState({});
34
 
35
  useEffect(async () => {
36
    const resData = (await axios.get(routeBrowsers)).data;
37
    if (!resData.success) {
38
      return dispatch(
39
        addNotification({
40
          style: "danger",
41
          msg: "Ha ocurrido un error, por favor recargue la pagina",
42
        })
43
      );
44
    }
45
    setBrowserData(resData.data);
46
  }, []);
47
 
48
  return (
49
    <div className="acc-setting">
50
      <h3>Navegadores</h3>
51
      <div
52
        className="cp-field"
53
        style={{
54
          marginBottom: "1rem",
55
        }}
56
      >
57
        <MaterialTable
58
          columns={BrowserTableColumns}
59
          rows={browserData.items}
60
          count={browserData.total}
61
        />
62
      </div>
63
    </div>
64
  );
65
};
66
 
67
export default Browsers;