editar, modificar, ver y crear productos listo

This commit is contained in:
2025-08-27 14:52:47 -04:00
parent f050db4359
commit 2d596b93ad
20 changed files with 242 additions and 183 deletions

View File

@@ -1,15 +1,4 @@
// 'use client';
// import PageContainer from '@/components/layout/page-container';
import { getProductById } from '@/feactures/inventory/actions/actions';
// import { SurveyResponse } from '@/feactures/surveys/components/survey-response';
import {
Card,
CardContent,
CardFooter,
CardHeader,
CardTitle,
} from '@repo/shadcn/card';
import {ProductList} from '@/feactures/inventory/components/products/see-product'
export default async function SurveyResponsePage({
@@ -19,16 +8,18 @@ export default async function SurveyResponsePage({
}) {
const { id } = await params; // You can still destructure id from params
if (!id || id === '') {
// Handle the case where no id is provided
return null;
}
if (!id || id === '') return null;
// Call the function passing the dynamic id
const data = await getProductById(Number(id));
if (!data?.data) {
return <div>Encuesta no encontrada</div>;
return (
<main className='flex h-full flex-col items-center justify-center'>
<p className='text-2xl'>Lo siento...</p>
<p className='text-4xl text-primary'>Producto no encontrado</p>
</main>
)
}
return (

View File

@@ -1,4 +1,4 @@
import PageContainer from '@/components/layout/page-container';
// import PageContainer from '@/components/layout/page-container';
import { ProductList } from '@/feactures/inventory/components/products/product-list';
import { Button } from '@repo/shadcn/components/ui/button';
import { Metadata } from 'next';
@@ -13,7 +13,7 @@ export default function SurveysPage() {
// <PageContainer>
<main className='p-4 md:px-6'>
<header className="w-full flex flex-col sm:flex-row sm:justify-between">
<h1 className="text-2xl font-bold mb-1">Productos Disponibles</h1>
<h1 className="text-2xl font-bold mb-1">Productos disponibles</h1>
<a className='mb-1' href="/dashboard/inventario">
<Button>Mi inventario</Button>
</a>