diff --git a/web-ui/web-react/src/App.js b/web-ui/web-react/src/App.js
index 48ea0ccd..efa23d58 100644
--- a/web-ui/web-react/src/App.js
+++ b/web-ui/web-react/src/App.js
@@ -58,6 +58,7 @@ import { useCookies } from "react-cookie";
import LogInUser from './components/LogInUser';
import Page404 from './components/Page404'
import Reservaciones from './components/Reservaciones';
+import PerfilAdminComunidad from './components/PerfilAdminComunidad';
const App = () => {
@@ -472,6 +473,7 @@ const App = () => {
+
>
)
} else {
diff --git a/web-ui/web-react/src/AppTopbar.js b/web-ui/web-react/src/AppTopbar.js
index f9226f50..122d6ef7 100644
--- a/web-ui/web-react/src/AppTopbar.js
+++ b/web-ui/web-react/src/AppTopbar.js
@@ -88,10 +88,11 @@ export const AppTopbar = (props) => {
*/}
-
diff --git a/web-ui/web-react/src/components/PerfilAdminComunidad.js b/web-ui/web-react/src/components/PerfilAdminComunidad.js
new file mode 100644
index 00000000..eee0b252
--- /dev/null
+++ b/web-ui/web-react/src/components/PerfilAdminComunidad.js
@@ -0,0 +1,287 @@
+import React, { useEffect, useState, useRef } from 'react';
+import { useCookies } from "react-cookie";
+import { DataTable } from 'primereact/datatable';
+import { Column } from 'primereact/column';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { faHome, faUserAlt } from '@fortawesome/free-solid-svg-icons';
+import { faMapLocationDot } from '@fortawesome/free-solid-svg-icons';
+import { faPhoneAlt } from '@fortawesome/free-solid-svg-icons';
+import { faHashtag } from '@fortawesome/free-solid-svg-icons';
+import { faCircleQuestion } from '@fortawesome/free-solid-svg-icons';
+
+const PerfilAdminComunidad = () => {
+
+ let emptyAdminCommunity = {
+ _id: null,
+ dni: '',
+ name: '',
+ last_name: '',
+ email: '',
+ phone: '',
+ password: '',
+ confirmPassword: '',
+ community_id: '',
+ community_name: '',
+ user_type: '2',
+ date_entry: new Date(),
+ status: '1',
+ status_text: '',
+ };
+
+ let emptyCommunity = {
+ _id: null,
+ name: '',
+ province: '',
+ canton: '',
+ district: '',
+ phone: '',
+ num_houses: 0,
+ status: '1',
+ status_text: '',
+ date_entry: new Date(),
+ houses: [],
+ };
+
+ const [admin, setAdmin] = useState(emptyAdminCommunity);
+ const [community, setCommunity] = useState(emptyCommunity);
+ const [cookies, setCookie] = useCookies();
+ const [globalFilter, setGlobalFilter] = useState(null);
+ //para el perfil de la comunidad
+ const [tenants, setTenants] = useState([]);
+
+
+ async function getAdmin() {
+ await fetch('http://localhost:4000/user/findUserById/' + cookies.id, { method: 'GET' })
+ .then((response) => response.json())
+ .then(data => {
+ let item = data.message;
+ setAdmin(item);
+ if (item.community_id || item.community_id != '') {
+ getCommunity()
+ } else {
+ item.community_name = "Sin Comunidad Asignada";
+ }
+
+ })
+ }
+
+
+ useEffect(() => {
+ getAdmin();
+ }, [])
+
+ async function getCommunity() {
+
+ fetch(`http://localhost:4000/community/findCommunityName/${cookies.community_id}`, { method: 'GET' })
+ .then((response2) => response2.json())
+ .then(data => data.message)
+ .then(data => {
+ setCommunity(data)
+ })
+ }
+
+ useEffect(() => {
+ getCommunity();
+ }, [])
+
+ async function tenantsList(id) {
+ await fetch(`http://localhost:4000/user/findTenants/${id}`, { method: 'GET' })
+ .then((response) => response.json())
+ .then(data => data.message)
+ .then(data => {
+ data = data.filter(
+ (val) => val.status != -1,
+ )
+ setTenants(data)
+ });
+ }
+
+ useEffect(() => {
+ tenantsList(community._id);
+ }, [])
+
+ function findNameTenant(tenant_id) {
+ let name = '';
+ if (tenant_id == '') {
+ name = 'Sin inquilino';
+ } else {
+ let tenant = tenants.find(t => t._id == tenant_id)
+ name = tenant['name'] + ' ' + tenant['last_name'];
+ }
+ return name;
+ }
+
+ const headerNumberHouses = (
+ <>
+
+ {' '}
+ {' '}
+ Código de vivienda
+
+ >
+ );
+
+ const headerTenant = (
+ <>
+
+ {' '}
+ {' '}
+ Inquilino
+
+
+ >
+ );
+
+ const tenantsBodyTemplate = (rowData) => {
+ let tenants = rowData.tenants;
+ let name = 'Sin inquilino';
+ if (rowData.tenants) {
+ name = findNameTenant(tenants.tenant_id);
+ }
+
+ return (
+ <>
+ {name}
+ >
+ )
+ }
+
+ return (
+
+
+ {community && (
+
+
+
+
+
Información Básica
+
+
+
+
+
Teléfono Administrativo
+
+
+
+
+
+
+
+
Viviendas de la Comunidad
+
+
+
+
+
Cantidad de Viviendas
+
+
+
{community.num_houses}
+
+
+
+
+
+
+
+ )}
+
+
+
+ )
+}
+
+export default React.memo(PerfilAdminComunidad)
\ No newline at end of file