-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pagina de alumnos que firmaron compromiso de pago
- Loading branch information
1 parent
458bd3b
commit 9e7e3ec
Showing
5 changed files
with
203 additions
and
1 deletion.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
...min/src/components/Pages/Estadisticas/SubPages/Alumnos-que-fimaron-compromiso-de-pago.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, { useState } from 'react'; | ||
import { Tabs, TabList, Tab, TabPanels, TabPanel } from '@chakra-ui/react'; | ||
import AlumnosConCompromiso from './AlumnosConCompromiso'; | ||
import AlumnosSinCompromiso from './AlumnosSinCompromiso'; | ||
|
||
const AlumnosCompromisoPago: React.FC = () => { | ||
const [index, setIndex] = useState(0); // Estado para manejar la pestaña seleccionada | ||
|
||
return ( | ||
<div> | ||
<Tabs variant="enclosed" index={index} onChange={setIndex} isLazy> | ||
<TabList display="flex" justifyContent="center" alignItems="center" borderBottom="2px solid" borderColor="gray.200"> | ||
<Tab | ||
_selected={{ | ||
borderBottom: "2px solid", | ||
borderColor: "blue.500", | ||
color: "blue.500", | ||
borderTop: "none", | ||
borderLeft: "none", | ||
borderRight: "none" | ||
}} | ||
_focus={{ boxShadow: "none" }} | ||
> | ||
Alumnos que firmaron Compromiso de Pago | ||
</Tab> | ||
<Tab | ||
_selected={{ | ||
borderBottom: "2px solid", | ||
borderColor: "blue.500", | ||
color: "blue.500", | ||
borderTop: "none", | ||
borderLeft: "none", | ||
borderRight: "none" | ||
}} | ||
_focus={{ boxShadow: "none" }} | ||
> | ||
Alumnos que no firmaron Compromiso de Pago | ||
</Tab> | ||
</TabList> | ||
|
||
<TabPanels> | ||
<TabPanel> | ||
<AlumnosConCompromiso /> | ||
</TabPanel> | ||
<TabPanel> | ||
<AlumnosSinCompromiso /> | ||
</TabPanel> | ||
</TabPanels> | ||
</Tabs> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AlumnosCompromisoPago; | ||
|
||
|
69 changes: 69 additions & 0 deletions
69
FrontAdmin/src/components/Pages/Estadisticas/SubPages/AlumnosConCompromiso.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { | ||
Box, | ||
Tab, | ||
TabList, | ||
TabPanels, | ||
Tabs, | ||
VStack, | ||
List, | ||
ListItem, | ||
Spinner, | ||
useTab, | ||
} from '@chakra-ui/react'; | ||
import { FetchAlumnos } from '../../../../API/DatosAlumnosV2'; | ||
|
||
interface Alumnos { | ||
nombre: string; | ||
legajo: number; | ||
dni: number; | ||
situacion: string; | ||
anio_ingreso: number; | ||
} | ||
|
||
const AlumnosConCompromiso: React.FC = () => { | ||
const [alumnos, setAlumnos] = useState<Alumnos[]>([]); | ||
const [loading, setLoading] = useState<boolean>(true); | ||
|
||
useEffect(() => { | ||
const fetchAlumnos = async () => { | ||
try { | ||
const response = await FetchAlumnos(); | ||
if (!response.ok) { | ||
throw new Error('Error al obtener los alumnos'); | ||
} | ||
const data: Alumnos[] = await response.json(); | ||
setAlumnos(data); | ||
} catch (error) { | ||
console.error(error); | ||
} finally { | ||
setLoading(false); | ||
} | ||
}; | ||
|
||
fetchAlumnos(); | ||
}, ); | ||
|
||
return ( | ||
<Box p={5}> | ||
<VStack spacing={4} align="stretch"> | ||
<Tabs variant="enclosed" isLazy> | ||
<TabPanels> | ||
<Box> | ||
<List spacing={3}> | ||
{alumnos.map(alumno => ( | ||
<ListItem key={alumno.legajo}> | ||
{alumno.nombre} (Legajo: {alumno.legajo}, DNI: {alumno.dni}, Situacion: {alumno.situacion}, Año Ingreso: {alumno.anio_ingreso}) | ||
</ListItem> | ||
))} | ||
</List> | ||
<h1>Prueba 1</h1> | ||
</Box> | ||
</TabPanels> | ||
</Tabs> | ||
</VStack> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default AlumnosConCompromiso; |
69 changes: 69 additions & 0 deletions
69
FrontAdmin/src/components/Pages/Estadisticas/SubPages/AlumnosSinCompromiso.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { | ||
Box, | ||
Tab, | ||
TabList, | ||
TabPanels, | ||
Tabs, | ||
VStack, | ||
List, | ||
ListItem, | ||
Spinner, | ||
useTab, | ||
} from '@chakra-ui/react'; | ||
import { FetchAlumnos } from '../../../../API/DatosAlumnosV2'; | ||
|
||
interface Alumnos { | ||
nombre: string; | ||
legajo: number; | ||
dni: number; | ||
situacion: string; | ||
anio_ingreso: number; | ||
} | ||
|
||
const AlumnosConCompromiso: React.FC = () => { | ||
const [alumnos, setAlumnos] = useState<Alumnos[]>([]); | ||
const [loading, setLoading] = useState<boolean>(true); | ||
|
||
useEffect(() => { | ||
const fetchAlumnos = async () => { | ||
try { | ||
const response = await FetchAlumnos(); | ||
if (!response.ok) { | ||
throw new Error('Error al obtener los alumnos'); | ||
} | ||
const data: Alumnos[] = await response.json(); | ||
setAlumnos(data); | ||
} catch (error) { | ||
console.error(error); | ||
} finally { | ||
setLoading(false); | ||
} | ||
}; | ||
|
||
fetchAlumnos(); | ||
}, ); | ||
|
||
return ( | ||
<Box p={5}> | ||
<VStack spacing={4} align="stretch"> | ||
<Tabs variant="enclosed" isLazy> | ||
<TabPanels> | ||
<Box> | ||
<List spacing={3}> | ||
{alumnos.map(alumno => ( | ||
<ListItem key={alumno.legajo}> | ||
{alumno.nombre} (Legajo: {alumno.legajo}, DNI: {alumno.dni}, Situacion: {alumno.situacion}, Año Ingreso: {alumno.anio_ingreso}) | ||
</ListItem> | ||
))} | ||
</List> | ||
</Box> | ||
<h1>Prueba 2</h1> | ||
</TabPanels> | ||
</Tabs> | ||
</VStack> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default AlumnosConCompromiso; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters