diff --git a/apps/docs/app/layout.tsx b/apps/docs/app/layout.tsx index 1c6adc0f..ee6d9449 100644 --- a/apps/docs/app/layout.tsx +++ b/apps/docs/app/layout.tsx @@ -1,8 +1,8 @@ -import "./global.css"; +import { GoogleAnalytics } from "@next/third-parties/google"; import { RootProvider } from "fumadocs-ui/provider"; import { Inter } from "next/font/google"; import type { ReactNode } from "react"; -import { GoogleAnalytics } from "@next/third-parties/google"; +import "./global.css"; const inter = Inter({ subsets: ["latin"], }); diff --git a/apps/website/app/[locale]/api/og/route.ts b/apps/website/app/[locale]/api/og/route.ts index 7a2dc790..f91ff5df 100644 --- a/apps/website/app/[locale]/api/og/route.ts +++ b/apps/website/app/[locale]/api/og/route.ts @@ -4,18 +4,14 @@ import type { NextRequest } from "next/server"; export async function GET( request: NextRequest, - { params }: { params: { locale: string } }, + { params }: { params: Promise<{ locale: string }> }, ) { try { const { searchParams } = new URL(request.url); const slug = searchParams.get("slug"); + const { locale } = await params; - console.log( - "Generating OG image for slug:", - slug, - "locale:", - params.locale, - ); + console.log("Generating OG image for slug:", slug, "locale:", locale); if (!slug) { console.error("Missing slug parameter"); @@ -32,7 +28,7 @@ export async function GET( console.log("Found post:", post.title); const formattedDate = new Date(post.published_at).toLocaleDateString( - params.locale, + locale, { year: "numeric", month: "long", diff --git a/apps/website/app/[locale]/blog/[slug]/page.tsx b/apps/website/app/[locale]/blog/[slug]/page.tsx index 95a95db9..d0271e35 100644 --- a/apps/website/app/[locale]/blog/[slug]/page.tsx +++ b/apps/website/app/[locale]/blog/[slug]/page.tsx @@ -105,25 +105,28 @@ export default async function BlogPostPage({ params }: Props) { const scripts = doc.querySelectorAll( 'script[type="application/ld+json"], script', ); - scripts.forEach((script) => script.remove()); + for (const script of scripts) { + script.remove(); + } // Remover otros elementos no deseados const unwantedElements = doc.querySelectorAll("style, meta, link"); - unwantedElements.forEach((el) => el.remove()); + for (const el of unwantedElements) { + el.remove(); + } return doc.body.innerHTML; - } else { - // Fallback para servidor - usar regex para limpiar - return html - .replace( - /]*type="application\/ld\+json"[^>]*>[\s\S]*?<\/script>/gi, - "", - ) - .replace(/]*>[\s\S]*?<\/script>/gi, "") - .replace(/]*>[\s\S]*?<\/style>/gi, "") - .replace(/]*>/gi, "") - .replace(/]*>/gi, ""); } + // Fallback para servidor - usar regex para limpiar + return html + .replace( + /]*type="application\/ld\+json"[^>]*>[\s\S]*?<\/script>/gi, + "", + ) + .replace(/]*>[\s\S]*?<\/script>/gi, "") + .replace(/]*>[\s\S]*?<\/style>/gi, "") + .replace(/]*>/gi, "") + .replace(/]*>/gi, ""); }; // Convertir HTML a Markdown @@ -214,11 +217,8 @@ export default async function BlogPostPage({ params }: Props) { className="object-cover max-w-lg mx-auto rounded-lg border max-lg:w-64 border-border overflow-hidden" /> ), - code: ({ - className, - children, - inline, - }: { className: string; children: React.ReactNode; inline: boolean }) => { + code: (props: any) => { + const { className, children, inline } = props; console.log(className, children, inline); // Si es código inline (no tiene className con language-*), renderizar como span if (inline || !className || !/language-(\w+)/.test(className)) { diff --git a/apps/website/app/[locale]/blog/page.tsx b/apps/website/app/[locale]/blog/page.tsx index cffd4500..04c18f06 100644 --- a/apps/website/app/[locale]/blog/page.tsx +++ b/apps/website/app/[locale]/blog/page.tsx @@ -21,8 +21,8 @@ export default async function BlogPage({ params, searchParams, }: { - params: { locale: string }; - searchParams: { [key: string]: string | string[] | undefined }; + params: Promise<{ locale: string }>; + searchParams: Promise<{ [key: string]: string | string[] | undefined }>; }) { const { locale } = await params; const searchParams2 = await searchParams; diff --git a/apps/website/app/[locale]/blog/tag/[tag]/page.tsx b/apps/website/app/[locale]/blog/tag/[tag]/page.tsx index c8806e5f..11b91a0b 100644 --- a/apps/website/app/[locale]/blog/tag/[tag]/page.tsx +++ b/apps/website/app/[locale]/blog/tag/[tag]/page.tsx @@ -23,7 +23,7 @@ export async function generateMetadata({ params }: Props): Promise { export async function generateStaticParams() { const tags = await getTags(); - return tags.map((tag: { slug: string }) => ({ + return tags.map((tag) => ({ tag: tag.slug, })); } @@ -74,7 +74,7 @@ export default async function TagPage({ params }: Props) {
{posts.map((post: Post) => ( - + ))}
diff --git a/apps/website/app/[locale]/contact/page.tsx b/apps/website/app/[locale]/contact/page.tsx index c15c0062..f27d6b16 100644 --- a/apps/website/app/[locale]/contact/page.tsx +++ b/apps/website/app/[locale]/contact/page.tsx @@ -1,8 +1,8 @@ "use client"; -import { useState } from "react"; -import { useTranslations } from "next-intl"; import { Container } from "@/components/Container"; +import { trackGAEvent } from "@/components/analitycs"; +import AnimatedGridPattern from "@/components/ui/animated-grid-pattern"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { @@ -12,9 +12,9 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { trackGAEvent } from "@/components/analitycs"; -import AnimatedGridPattern from "@/components/ui/animated-grid-pattern"; import { cn } from "@/lib/utils"; +import { useTranslations } from "next-intl"; +import { useState } from "react"; interface ContactFormData { inquiryType: "" | "support" | "sales" | "other"; diff --git a/apps/website/app/[locale]/layout.tsx b/apps/website/app/[locale]/layout.tsx index 8a7729ea..2f06c8bf 100644 --- a/apps/website/app/[locale]/layout.tsx +++ b/apps/website/app/[locale]/layout.tsx @@ -74,7 +74,7 @@ export default async function RootLayout({ params, }: { children: React.ReactNode; - params: { locale: string }; + params: Promise<{ locale: string }>; }) { const { locale } = await params; setRequestLocale(locale); diff --git a/apps/website/app/[locale]/page.tsx b/apps/website/app/[locale]/page.tsx index c7d65a2e..1c0fbf62 100644 --- a/apps/website/app/[locale]/page.tsx +++ b/apps/website/app/[locale]/page.tsx @@ -9,7 +9,9 @@ import { Sponsors } from "@/components/sponsors"; import { StatsSection } from "@/components/stats"; import { setRequestLocale } from "next-intl/server"; -export default async function Home({ params }: { params: { locale: string } }) { +export default async function Home({ + params, +}: { params: Promise<{ locale: string }> }) { const { locale } = await params; setRequestLocale(locale); return ( diff --git a/apps/website/app/api/contact/route.ts b/apps/website/app/api/contact/route.ts index 26469e18..a4891151 100644 --- a/apps/website/app/api/contact/route.ts +++ b/apps/website/app/api/contact/route.ts @@ -1,7 +1,7 @@ +import { getHubSpotUTK, submitToHubSpot } from "@/lib/hubspot"; import type { NextRequest } from "next/server"; import { NextResponse } from "next/server"; import { Resend } from "resend"; -import { submitToHubSpot, getHubSpotUTK } from "@/lib/hubspot"; interface ContactFormData { inquiryType: "support" | "sales" | "other"; diff --git a/apps/website/app/layout.tsx b/apps/website/app/layout.tsx index 7f3c600e..363059cc 100644 --- a/apps/website/app/layout.tsx +++ b/apps/website/app/layout.tsx @@ -1,10 +1,10 @@ +import { GoogleAnalytics } from "@next/third-parties/google"; import clsx from "clsx"; import type { Metadata } from "next"; import { NextIntlClientProvider } from "next-intl"; import { getMessages } from "next-intl/server"; import { Inter, Lexend } from "next/font/google"; import type { ReactNode } from "react"; -import { GoogleAnalytics } from "@next/third-parties/google"; type Props = { children: ReactNode; @@ -49,9 +49,9 @@ export default async function RootLayout({ params, }: { children: ReactNode; - params: { locale: string }; + params: Promise<{ locale: string }>; }) { - const { locale } = params; + const { locale } = await params; const messages = await getMessages(); return ( {t("navigation.blog")} - {t("navigation.contact")} + + {t("navigation.contact")} +