154 lines
4.9 KiB
TypeScript
154 lines
4.9 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { NextIntlClientProvider } from "next-intl";
|
|
import { getMessages, setRequestLocale } from "next-intl/server";
|
|
import Script from "next/script";
|
|
import { ThemeProvider } from "@/components/theme-provider";
|
|
import { QueryProvider } from "@/lib/providers/query-provider";
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: Promise<{ locale: string }>;
|
|
}): Promise<Metadata> {
|
|
const { locale } = await params;
|
|
|
|
const titles = {
|
|
pt: "Tibia Trade - Marketplace Seguro para Compra e Venda de Itens",
|
|
en: "Tibia Trade - Secure Marketplace for Buying and Selling Items",
|
|
};
|
|
|
|
const descriptions = {
|
|
pt: "Marketplace oficial multi-servidor para negociar itens de Tibia com segurança total. Sistema escrow protege 100% das transações. Compre e venda gold, TC, armaduras raras e equipamentos.",
|
|
en: "Official multi-server marketplace to trade Tibia items with total security. Escrow system protects 100% of transactions. Buy and sell gold, TC, rare armors and equipment.",
|
|
};
|
|
|
|
return {
|
|
title: {
|
|
default: titles[locale as keyof typeof titles],
|
|
template: `%s | Tibia Trade`,
|
|
},
|
|
description: descriptions[locale as keyof typeof descriptions],
|
|
keywords: [
|
|
"tibia marketplace",
|
|
"tibia trade",
|
|
"comprar itens tibia",
|
|
"vender itens tibia",
|
|
"tibia escrow",
|
|
"tibia gold",
|
|
"tibia coins",
|
|
"tc tibia",
|
|
"marketplace tibia seguro",
|
|
"tibia bid system",
|
|
"tibia item escrow",
|
|
"tibia multi-server marketplace",
|
|
],
|
|
authors: [{ name: "Tibia Trade Team" }],
|
|
creator: "Tibia Trade",
|
|
publisher: "Tibia Trade",
|
|
robots: {
|
|
index: true,
|
|
follow: true,
|
|
googleBot: {
|
|
index: true,
|
|
follow: true,
|
|
"max-video-preview": -1,
|
|
"max-image-preview": "large",
|
|
"max-snippet": -1,
|
|
},
|
|
},
|
|
alternates: {
|
|
canonical: `https://tibiatrade.evandro.dev.br/${locale}`,
|
|
languages: {
|
|
"pt-BR": `https://tibiatrade.evandro.dev.br/pt`,
|
|
"en-US": `https://tibiatrade.evandro.dev.br/en`,
|
|
},
|
|
},
|
|
openGraph: {
|
|
type: "website",
|
|
locale: locale === "pt" ? "pt_BR" : "en_US",
|
|
url: `https://tibiatrade.evandro.dev.br/${locale}`,
|
|
title: titles[locale as keyof typeof titles],
|
|
description: descriptions[locale as keyof typeof descriptions],
|
|
siteName: "Tibia Trade",
|
|
images: [
|
|
{
|
|
url: "/og-image.png",
|
|
width: 1200,
|
|
height: 630,
|
|
alt: "Tibia Trade - Marketplace Seguro",
|
|
},
|
|
],
|
|
},
|
|
twitter: {
|
|
card: "summary_large_image",
|
|
title: titles[locale as keyof typeof titles],
|
|
description: descriptions[locale as keyof typeof descriptions],
|
|
images: ["/og-image.png"],
|
|
creator: "@tibiatrade",
|
|
},
|
|
icons: {
|
|
icon: [
|
|
{ url: "/favicon.ico", type: "image/x-icon" },
|
|
{ url: "/icon.svg", type: "image/svg+xml" },
|
|
],
|
|
apple: "/apple-touch-icon.png",
|
|
},
|
|
};
|
|
}
|
|
|
|
export default async function LocaleLayout({
|
|
children,
|
|
params,
|
|
}: {
|
|
children: React.ReactNode;
|
|
params: Promise<{ locale: string }>;
|
|
}) {
|
|
const { locale } = await params;
|
|
setRequestLocale(locale);
|
|
const messages = await getMessages();
|
|
|
|
const baseUrl = "https://tibiatrade.evandro.dev.br";
|
|
|
|
return (
|
|
<QueryProvider>
|
|
<NextIntlClientProvider messages={messages}>
|
|
<ThemeProvider attribute="class" defaultTheme="dark">
|
|
<Script id="structured-data-organization" type="application/ld+json" strategy="afterInteractive">
|
|
{JSON.stringify({
|
|
"@context": "https://schema.org",
|
|
"@type": "Organization",
|
|
name: "Tibia Trade",
|
|
url: baseUrl,
|
|
logo: `${baseUrl}/logo.png`,
|
|
description: "Marketplace multi-servidor seguro para negociação de itens de Tibia",
|
|
sameAs: ["https://discord.gg/tibiatrade"],
|
|
contactPoint: {
|
|
"@type": "ContactPoint",
|
|
contactType: "Customer Support",
|
|
availableLanguage: ["Portuguese", "English"],
|
|
},
|
|
})}
|
|
</Script>
|
|
<Script id="structured-data-website" type="application/ld+json" strategy="afterInteractive">
|
|
{JSON.stringify({
|
|
"@context": "https://schema.org",
|
|
"@type": "WebSite",
|
|
name: "Tibia Trade",
|
|
url: baseUrl,
|
|
potentialAction: {
|
|
"@type": "SearchAction",
|
|
target: {
|
|
"@type": "EntryPoint",
|
|
urlTemplate: `${baseUrl}/market?q={search_term_string}`,
|
|
},
|
|
"query-input": "required name=search_term_string",
|
|
},
|
|
})}
|
|
</Script>
|
|
<div data-locale={locale}>{children}</div>
|
|
</ThemeProvider>
|
|
</NextIntlClientProvider>
|
|
</QueryProvider>
|
|
);
|
|
}
|