corregido errores de compilacion para next en web
This commit is contained in:
@@ -2,7 +2,7 @@ import PageContainer from '@/components/layout/page-container';
|
||||
import SurveysAdminList from '@/feactures/surveys/components/admin/surveys-admin-list';
|
||||
import { SurveysHeader } from '@/feactures/surveys/components/admin/surveys-header';
|
||||
import SurveysTableAction from '@/feactures/surveys/components/admin/surveys-tables/survey-table-action';
|
||||
import { searchParamsCache, serialize } from '@/feactures/surveys/utils/searchparams';
|
||||
import { searchParamsCache } from '@/feactures/surveys/utils/searchparams';
|
||||
import { SearchParams } from 'nuqs';
|
||||
|
||||
type pageProps = {
|
||||
@@ -13,8 +13,7 @@ type pageProps = {
|
||||
export default async function SurveyAdminPage(props: pageProps) {
|
||||
const searchParams = await props.searchParams;
|
||||
searchParamsCache.parse(searchParams);
|
||||
const key = serialize({ ...searchParams });
|
||||
|
||||
|
||||
const page = Number(searchParamsCache.get('page')) || 1;
|
||||
const search = searchParamsCache.get('q');
|
||||
const pageLimit = Number(searchParamsCache.get('limit')) || 10;
|
||||
|
||||
@@ -2,7 +2,7 @@ import PageContainer from '@/components/layout/page-container';
|
||||
import UsersAdminList from '@/feactures/users/components/admin/users-admin-list';
|
||||
import { UsersHeader } from '@/feactures/users/components/admin/users-header';
|
||||
import UsersTableAction from '@/feactures/users/components/admin/surveys-tables/users-table-action';
|
||||
import { searchParamsCache, serialize } from '@/feactures/users/utils/searchparams';
|
||||
import { searchParamsCache } from '@/feactures/users/utils/searchparams';
|
||||
import { SearchParams } from 'nuqs';
|
||||
|
||||
type pageProps = {
|
||||
@@ -13,7 +13,7 @@ type pageProps = {
|
||||
export default async function SurveyAdminPage(props: pageProps) {
|
||||
const searchParams = await props.searchParams;
|
||||
searchParamsCache.parse(searchParams);
|
||||
const key = serialize({ ...searchParams });
|
||||
|
||||
|
||||
const page = Number(searchParamsCache.get('page')) || 1;
|
||||
const search = searchParamsCache.get('q');
|
||||
|
||||
@@ -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 función 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>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
import Image from 'next/image';
|
||||
|
||||
export default async function Page() {
|
||||
|
||||
return (
|
||||
// <PageContainer>
|
||||
<div className="flex justify-center items-center h-full">
|
||||
<img src="../logo.png" alt="Image" className="w-1/4"/>
|
||||
<Image
|
||||
src="/logo.png" // OJO: la ruta debe ser desde /public (sin '..')
|
||||
alt="Image"
|
||||
width={400} // Ajusta el tamaño según tu imagen
|
||||
height={400}
|
||||
className="w-1/4 h-auto" // Puedes seguir usando Tailwind para responsividad
|
||||
priority // Opcional: para imágenes importantes arriba del todo
|
||||
/>
|
||||
</div>
|
||||
// </PageContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { AppSidebar } from '@/components/layout/app-sidebar';
|
||||
import Header from '@/components/layout/header';
|
||||
import { SidebarInset, SidebarProvider } from '@repo/shadcn/sidebar';
|
||||
import type { Metadata } from 'next';
|
||||
import { cookies } from 'next/headers';
|
||||
//import { cookies } from 'next/headers';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Dashboard',
|
||||
@@ -15,7 +15,7 @@ export default async function DashboardLayout({
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
// Persisting the sidebar state in the cookie.
|
||||
const cookieStore = await cookies();
|
||||
//const cookieStore = await cookies();
|
||||
//const defaultOpen = cookieStore.get('sidebar:state')?.value === 'false';
|
||||
return (
|
||||
<SidebarProvider defaultOpen={true}>
|
||||
|
||||
Reference in New Issue
Block a user