diff --git a/client/package.json b/client/package.json index ca912340..7b31ccd3 100644 --- a/client/package.json +++ b/client/package.json @@ -1,7 +1,7 @@ { "name": "client", "private": true, - "version": "0.16.1", + "version": "0.16.2", "type": "module", "scripts": { "dev": "vite --open", diff --git a/client/src/components/Register-list/RegisterList.jsx b/client/src/components/Register-list/RegisterList.jsx index 760eb296..21b544cd 100644 --- a/client/src/components/Register-list/RegisterList.jsx +++ b/client/src/components/Register-list/RegisterList.jsx @@ -24,6 +24,7 @@ import { keysRoles } from '../../import/staticData' import { LoadingModal, Modals } from '../Utils/Modals/Modals' import Cookies from 'js-cookie' import Swal from 'sweetalert2' +import { BiSad } from 'react-icons/bi' export const modalOptionList = { confirmModal: 'confirm', @@ -39,6 +40,7 @@ export const RegisterList = () => { const [fileName, setFileName] = useState(null) const [modalOption, setModalOption] = useState(modalOptionList.confirmModal) const [username, setUsername] = useState(null) + const [loadingData, setLoadingData] = useState(true) const excelRef = useRef() const navigate = useNavigate() @@ -86,6 +88,7 @@ export const RegisterList = () => { const response = await getInscriptions() const { data } = response.data setInscriptions(data) + setLoadingData(false) } catch (error) { throw new Error(error) } @@ -187,7 +190,7 @@ export const RegisterList = () => { - + @@ -210,7 +213,7 @@ export const RegisterList = () => { ) } -const TableList = ({ inscriptions, startIndex = 0, endIndex = 6 }) => { +const TableList = ({ inscriptions, startIndex = 0, endIndex = 6, loadingData }) => { const navigate = useNavigate() const handleAvales = (id) => { return navigate(`/registro-detalles/${id}`) @@ -228,9 +231,7 @@ const TableList = ({ inscriptions, startIndex = 0, endIndex = 6 }) => { - {inscriptions.length === 0 ? ( - - ) : ( + {inscriptions.length > 0 ? ( inscriptions.slice(startIndex, endIndex).map((x) => { return ( @@ -252,6 +253,15 @@ const TableList = ({ inscriptions, startIndex = 0, endIndex = 6 }) => { ) }) + ) : loadingData ? ( + + ) : ( + + + ¡Oops! No hay ningún aprendiz con este filtro. + + + )}
¡Oops! No hay ningún aprendiz con este filtro.