diff --git a/package.json b/package.json index 0fe53fd..c76b57b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "next dev --turbopack", "build": "next build", "start:local": "next build && next start -p 3246", - "start": "source ~/.nvm/nvm.sh && nvm use 22.10.0 && npm install && next build && next start -p 3246", + "start:dev": "source ~/.nvm/nvm.sh && nvm use 22.10.0 && npm install && next build && next start -p 3246", + "start:prod": "source ~/.nvm/nvm.sh && nvm use 22.10.0 && npm install && next build && next start -p 3240", "lint": "next lint" }, "dependencies": { diff --git a/src/app/(admins)/administrador/formulario/[id_formulario]/page.tsx b/src/app/(admins)/administrador/formulario/[id_formulario]/page.tsx index 0992585..fe68614 100644 --- a/src/app/(admins)/administrador/formulario/[id_formulario]/page.tsx +++ b/src/app/(admins)/administrador/formulario/[id_formulario]/page.tsx @@ -1,8 +1,10 @@ 'use client'; +import Button from '@/components/button'; import Input from '@/components/input'; import Table, { Header } from '@/components/table'; import { ParticipacionEvento } from '@/types/participante-evento'; import axiosInstance from '@/utils/api-config'; +import { downloadFile } from '@/utils/downloas-utils'; import { useParams } from 'next/navigation'; import React, { useEffect } from 'react'; import toast from 'react-hot-toast'; @@ -116,10 +118,29 @@ export default function Page() { p.participante.correo.toLowerCase().includes(busquedaCorreo.toLowerCase()) ); + const handleDownload = async () => { + try { + const res = await axiosInstance.get( + `/cuestionario-respondido/reporte-respuestas/${id_formulario}`, + { + responseType: 'blob', + } + ); + + downloadFile(res.data, 'lista_participantes', 'xlsx'); + } catch (error) { + toast.error('Error al descargar la lista de participantes'); + console.error('Error al descargar la lista de participantes:', error); + } + }; + return (

Participantes del formulario #{id_formulario}

+ {participantes.length > 0 && ( <> -
+
- {eventos.map((cuestionario) => ( - - ))} - {eventos.length === 0 && ( -

- No hay formularios disponibles. -

- )} + {eventos.map((cuestionario, index) => { + const fadeClass = `delay-${(index % 5) + 1}`; + + return ( +
+ +
+ ); + })}
diff --git a/src/app/(admins)/staff/lista-manual/page.tsx b/src/app/(admins)/staff/lista-manual/page.tsx index fbec8d3..2dfcfe6 100644 --- a/src/app/(admins)/staff/lista-manual/page.tsx +++ b/src/app/(admins)/staff/lista-manual/page.tsx @@ -6,7 +6,6 @@ import Table, { Header } from '@/components/table'; import { GetCuestionario } from '@/types/cuestionario'; import { ParticipacionEvento } from '@/types/participante-evento'; import axiosInstance from '@/utils/api-config'; -import { downloadFile } from '@/utils/downloas-utils'; import React, { useEffect } from 'react'; import toast from 'react-hot-toast'; @@ -73,9 +72,6 @@ export default function Page() { Record >({}); const [busquedaCorreo, setBusquedaCorreo] = React.useState(''); - const [idEventoSeleccionado, setIdEventoSeleccionado] = React.useState< - number | null - >(null); useEffect(() => { const getEventos = async () => { @@ -93,7 +89,6 @@ export default function Page() { const handleOnSelect = async (idSeleccionado: number) => { try { - setIdEventoSeleccionado(idSeleccionado); const { data } = await axiosInstance.get( `/participante-evento/evento/${idSeleccionado}` ); @@ -128,22 +123,6 @@ export default function Page() { p.participante.correo.toLowerCase().includes(busquedaCorreo.toLowerCase()) ); - const handleDownload = async () => { - try { - const res = await axiosInstance.get( - `/cuestionario-respondido/reporte-respuestas/${idEventoSeleccionado}`, - { - responseType: 'blob', - } - ); - - downloadFile(res.data, 'lista_participantes', 'xlsx'); - } catch (error) { - toast.error('Error al descargar la lista de participantes'); - console.error('Error al descargar la lista de participantes:', error); - } - }; - return (
Cargando cuestionarios...
; + if (loading) + return
Cargando cuestionarios...
; if (error) return
{error}
; return ( <> -
+
diff --git a/src/components/formulario-card.tsx b/src/components/formulario-card.tsx index b8d6784..a1dca6c 100644 --- a/src/components/formulario-card.tsx +++ b/src/components/formulario-card.tsx @@ -31,7 +31,7 @@ export default function FormularioCard({ return (
-
+
router.push(link)} outline className="mt-3 w-100 py-1 rounded" - variant="primary" + variant="azul" > {button_message} diff --git a/src/components/layout/footer.tsx b/src/components/layout/footer.tsx index 486d041..0d86483 100644 --- a/src/components/layout/footer.tsx +++ b/src/components/layout/footer.tsx @@ -5,15 +5,15 @@ export default function Footer() { const year = date.getFullYear(); return ( -