base con autenticacion, registro, modulo encuestas
This commit is contained in:
24
apps/web/app/dashboard/encuestas/[id]/responder/page.tsx
Normal file
24
apps/web/app/dashboard/encuestas/[id]/responder/page.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import PageContainer from '@/components/layout/page-container';
|
||||
import { getSurveyByIdAction } from '@/feactures/surveys/actions/surveys-actions';
|
||||
import { SurveyResponse } from '@/feactures/surveys/components/survey-response';
|
||||
|
||||
// La función ahora recibe 'params' con el parámetro dinámico 'id'
|
||||
export default async function SurveyResponsePage({ params }: { params: { id: string } }) {
|
||||
const { id } = await params; // Obtienes el id desde los params de la URL
|
||||
|
||||
if (!id || id === '') {
|
||||
// Maneja el caso en el que no se proporciona un id
|
||||
return null;
|
||||
}
|
||||
|
||||
// Llamas a la función pasando el id dinámico
|
||||
const data = await getSurveyByIdAction(Number(id));
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<div className="flex flex-1 flex-col space-y-4">
|
||||
<SurveyResponse survey={data?.data!} />
|
||||
</div>
|
||||
</PageContainer>
|
||||
);
|
||||
}
|
||||
21
apps/web/app/dashboard/encuestas/page.tsx
Normal file
21
apps/web/app/dashboard/encuestas/page.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import PageContainer from '@/components/layout/page-container';
|
||||
import { SurveyList } from '@/feactures/surveys/components/survey-list';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Encuestas - Fondemi',
|
||||
description: 'Listado de encuestas disponibles',
|
||||
};
|
||||
|
||||
export default function SurveysPage() {
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<div className="w-full">
|
||||
<h1 className="text-2xl font-bold mb-6">Encuestas Disponibles</h1>
|
||||
<SurveyList />
|
||||
</div>
|
||||
</PageContainer>
|
||||
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user