Vista (intefaz y bd), esquema y endpoints de store agregados

This commit is contained in:
2025-07-02 15:10:54 -04:00
parent f5962efb8b
commit 365cbd0d7a
19 changed files with 1909 additions and 76 deletions

View File

@@ -0,0 +1,33 @@
import PageContainer from '@/components/layout/page-container';
import { getSurveyByIdAction } from '@/feactures/surveys/actions/surveys-actions';
import { SurveyResponse } from '@/feactures/surveys/components/survey-response';
export default async function SurveyResponsePage({
params,
}: {
params: Promise<{ id: string }>
}) {
const { id } = await params; // You can still destructure id from params
if (!id || id === '') {
// Handle the case where no id is provided
return null;
}
// 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>
</PageContainer>
);
}

View File

@@ -0,0 +1,21 @@
import PageContainer from '@/components/layout/page-container';
import { SurveyList } from '@/feactures/inventory/components/products/product-list';
import { Metadata } from 'next';
export const metadata: Metadata = {
title: 'Productos - Fondemi',
description: 'Listado de productos disponibles',
};
export default function SurveysPage() {
return (
<PageContainer>
<div className="w-full">
<h1 className="text-2xl font-bold mb-6">Productos Disponibles</h1>
<SurveyList />
</div>
</PageContainer>
);
}