25 lines
859 B
TypeScript
25 lines
859 B
TypeScript
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>
|
|
);
|
|
}
|