import React, { useState, useCallback} from 'react';
import { Row, Col } from 'react-bootstrap'
import { Toaster } from 'react-hot-toast';
// import toast, { Toaster } from 'react-hot-toast';
import {
ToggleButton, ToggleButtonGroup, Box,
Paper, Pagination,
} from '@mui/material';
import { ViewList as ViewListIcon, ViewModule as ViewModuleIcon, } from '@mui/icons-material';
import { default as useAuth } from '../Auth/useAuth';
import { Service } from '../Utils/HTTP';
import { Divide } from '../Utils/Paginate';
import Express from '../Components/Modal/AgregarExpress';
import Manual from '../Components/Modal/AgregarManual';
import Editar from '../Components/Modal/EditPlaza';
import Eliminar from '../Components/Modal/EliminarPlaza';
import Mostrar from '../Components/Modal/MostrarPlaza';
import { ListMode } from '../Components/Puestos/ListMode'
import { GridMode } from '../Components/Puestos/GridMode'
import { Add as AddIcon, } from '@mui/icons-material/'
import { Loading } from '../Components/Generics/loading'
import { ErrorMessage } from '../Components/Generics/Error'
import { useQuery } from 'react-query';
export function Puestos() {
const auth = useAuth();
const token = auth.getToken();
const [page, setPage] = useState(1);
const getAll = async () => {
let rest = new Service("/plaza/getall")
let response = await rest.getQuery(token);
return response;
}
const { isLoading, error, data : result } = useQuery('puestos', getAll);
const changePage = useCallback((_, value) => setPage(value),[]);
const [alignment, setAlignment] = React.useState('grid');
const handleChange = useCallback((_event, newAlignment) => setAlignment(newAlignment),[])
const children = [