Rev 9506 | Rev 9512 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React, { useState, useEffect } from 'react'import axios from 'axios'const headers = [{ key: "name", label: "Nombre", isSorteable: true },{ key: "minimum_no_of_employee", label: "Mínimo", isSorteable: true },{ key: "maximum_no_of_employee", label: "Máximo", isSorteable: true },{ key: "status", label: "Activo", isSorteable: false },{ key: "actions", label: "Acciones", isSorteable: false }]const MainView = ({ add_link, dashboard_link, permisions, table_link }) => {const [data, setData] = useState({})const getData = ({ url = '', params = {} }) => {axios.get(url, { params: { ...params } }).then(({ data }) => {if (data.success) {setData(data.data)return data.data}}).catch((err) => console.log(err))}useEffect(() => {getData(table_link)}, [])return (<h1>Hello</h1>)}export default MainView