corregido errores de compilacion para next en web

This commit is contained in:
2025-06-18 12:11:05 -04:00
parent a9a5dad0dd
commit 097eb7c8a2
29 changed files with 195 additions and 145 deletions

View File

@@ -2,23 +2,32 @@ 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
export default async function SurveyResponsePage({
params,
}: {
params: Promise<{ id: string }>
}) {
const { id } = await params; // You can still destructure id from params
if (!id || id === '') {
// Maneja el caso en el que no se proporciona un id
// Handle the case where no id is provided
return null;
}
// Llamas a la funcn pasando el id dinámico
// Call the function passing the dynamic id
const data = await getSurveyByIdAction(Number(id));
if (!data?.data) {
return <div>Encuesta no encontrada</div>;
}
return (
<PageContainer>
<div className="flex flex-1 flex-col space-y-4">
<SurveyResponse survey={data?.data!} />
</div>
<div className="flex flex-1 flex-col space-y-4">
<SurveyResponse survey={data?.data} />
</div>
</PageContainer>
);
}
}