diff --git a/web-ui/web-react/src/App.js b/web-ui/web-react/src/App.js index 164aaa17..48ea0ccd 100644 --- a/web-ui/web-react/src/App.js +++ b/web-ui/web-react/src/App.js @@ -34,6 +34,7 @@ import GuardasSeguridad from './components/GuardasSeguridad'; import Communities from './components/ComunidadViviendas'; import Inquilinos from './components/Inquilinos'; import RegistroComunicado from './components/RegistroComunicado'; +import InvitadosComunidad from './components/InvitadosComunidad'; import "../node_modules/bootstrap/dist/css/bootstrap.min.css"; import Crud from './pages/Crud'; @@ -202,10 +203,9 @@ const App = () => { icon: PrimeIcons.BUILDING, to: '/areasComunes', }, - + { label: 'Comunicados', icon: PrimeIcons.COMMENTS, to: '/registroComunicado' }, + { label: 'Invitados', icon: PrimeIcons.USERS, to: '/invitadosComunidad' }, { label: 'Reservaciones', icon: PrimeIcons.CALENDAR, to: '/reservaciones'}, - { label: 'Comunicados', icon: PrimeIcons.COMMENTS, to: '/registroComunicado'}, - ] }, ] @@ -471,6 +471,7 @@ const App = () => { + ) } else { diff --git a/web-ui/web-react/src/components/InvitadosComunidad.js b/web-ui/web-react/src/components/InvitadosComunidad.js new file mode 100644 index 00000000..4e59b24f --- /dev/null +++ b/web-ui/web-react/src/components/InvitadosComunidad.js @@ -0,0 +1,219 @@ +import React, { useEffect, useState, useRef } from 'react'; +import { InputText } from 'primereact/inputtext'; +import { Button } from 'primereact/button'; +import { DataTable } from 'primereact/datatable'; +import { Column } from 'primereact/column'; +import { Toast } from 'primereact/toast'; +import { Dialog } from 'primereact/dialog'; +import { Toolbar } from 'primereact/toolbar'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faUserAlt } from '@fortawesome/free-solid-svg-icons'; +import { faPhoneAlt } from '@fortawesome/free-solid-svg-icons'; +import { faAt } from '@fortawesome/free-solid-svg-icons'; +import { faIdCardAlt } from '@fortawesome/free-solid-svg-icons'; +import { faCircleQuestion } from '@fortawesome/free-solid-svg-icons'; +import { useCookies } from 'react-cookie'; +import classNames from 'classnames'; + +const InvitadosComunidad = () => { + const [cookies] = useCookies(); + const [globalFilter, setGlobalFilter] = useState(null); + const [invitados, setInvitados] = useState([]); + const [selectedInvitados, setSelectedInvitados] = useState([]); + const tableRef = useRef(null); + const toastRef = useRef(null); + + const getInvitados = async () => { + await fetch(`http://localhost:4000/guest/allGuests`, { + method: 'GET', + }) + .then((response) => response.json()) + .then((data) => data.message) + .then((data) => { + data = data.filter( + (invitado) => invitado.community === cookies.community_id, + ); + setInvitados(data); + }); + }; + + useEffect(() => { + getInvitados(); + }, [getInvitados, invitados]); + + const leftToolbarTemplate = () => { + return ( + +
+

Boton Eliminar aqui

+
+
+ ); + }; + + const rightToolbarTemplate = () => { + return ( + +