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,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;

View File

@@ -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');

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>
);
}
}

View File

@@ -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>
);
}

View File

@@ -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}>

View File

@@ -15,33 +15,52 @@ export async function GET(req: NextRequest) {
return new ImageResponse(
(
<div
tw="flex h-full w-full bg-black text-white"
style={{ fontFamily: 'Geist Sans' }}
style={{
display: 'flex',
height: '100%',
width: '100%',
backgroundColor: '#000',
color: '#fff',
fontFamily: 'Geist Sans'
}}
>
<div tw="flex border absolute border-stone-700 border-dashed inset-y-0 left-16 w-[1px]" />
<div tw="flex border absolute border-stone-700 border-dashed inset-y-0 right-16 w-[1px]" />
<div tw="flex border absolute border-stone-700 inset-x-0 h-[1px] top-16" />
<div tw="flex border absolute border-stone-700 inset-x-0 h-[1px] bottom-16" />
<div tw="flex absolute flex-row bottom-24 right-24 text-white"></div>
<div tw="flex flex-col absolute w-[896px] justify-center inset-32">
<div
tw="tracking-tight flex-grow-1 flex flex-col justify-center leading-[1.1]"
style={{
textWrap: 'balance',
fontWeight: 600,
fontSize: title && title.length > 20 ? 64 : 80,
letterSpacing: '-0.04em',
}}
>
<div style={{
position: 'absolute',
border: '1px dashed #404040',
top: 0,
bottom: 0,
left: '64px',
width: '1px'
}} />
{/* Repite el mismo patrón para los otros bordes */}
<div style={{
position: 'absolute',
display: 'flex',
flexDirection: 'column',
width: '896px',
justifyContent: 'center',
top: '128px',
bottom: '128px',
left: '128px',
right: '128px'
}}>
<div style={{
letterSpacing: '-0.04em',
textWrap: 'balance' as any,
fontWeight: 600,
fontSize: title && title.length > 20 ? 64 : 80,
lineHeight: '1.1'
}}>
{title}
</div>
<div
tw="text-[40px] leading-[1.5] flex-grow-1 text-stone-400"
style={{
fontWeight: 500,
textWrap: 'balance',
}}
>
<div style={{
fontSize: '40px',
lineHeight: '1.5',
color: '#a3a3a3',
fontWeight: 500,
textWrap: 'balance' as any
}}>
{`${description?.slice(0, 100)}`}
</div>
</div>
@@ -57,6 +76,6 @@ export async function GET(req: NextRequest) {
style: 'normal',
},
],
},
}
);
}

View File

@@ -1,8 +1,9 @@
/* eslint-disable @next/next/no-img-element */
import { ImageResponse } from 'next/og';
export const runtime = 'edge';
// Image metadata
export const alt = `Opengraph Image`;
export const size = {
width: 800,