Autoría | Ultima modificación | Ver Log |
import {axios} from "../../../utils";
import React, { useEffect, useState } from "react";
import { useDispatch } from "react-redux";
import { addNotification } from "../../../redux/notification/notification.actions";
import MaterialTable from "../../../shared/materialTable/MaterialTable";
const BrowserTableColumns = [
{
field: "platform",
headerName: "Plataforma",
},
{
field: "browser",
headerName: "Navegadores",
},
{
field: "device_type",
headerName: "Tipo",
},
{
field: "version",
headerName: "Versión",
},
{
field: "updated_on",
headerName: "Fecha",
},
];
const Browsers = ({ routeBrowsers }) => {
const dispatch = useDispatch();
const [browserData, setBrowserData] = useState({});
useEffect(async () => {
const resData = (await axios.get(routeBrowsers)).data;
if (!resData.success) {
return dispatch(
addNotification({
style: "danger",
msg: "Ha ocurrido un error, por favor recargue la pagina",
})
);
}
setBrowserData(resData.data);
}, []);
return (
<div className="acc-setting">
<h3>Navegadores</h3>
<div
className="cp-field"
style={{
marginBottom: "1rem",
}}
>
<MaterialTable
columns={BrowserTableColumns}
rows={browserData.items}
count={browserData.total}
/>
</div>
</div>
);
};
export default Browsers;