- wrap root layout with QueryProvider for React Query - replace market UnderConstruction placeholder with MarketClient and real data fetching - implement search, pagination, and sort via search params using getActiveListings - add necessary client components and queries - update dependencies (e.g., prisma, pkg-types)
176 lines
5.4 KiB
TypeScript
176 lines
5.4 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Geist, Geist_Mono, Nunito_Sans } from "next/font/google";
|
|
import { NextIntlClientProvider } from "next-intl";
|
|
import { getMessages } from "next-intl/server";
|
|
import { ThemeProvider } from "@/components/theme-provider";
|
|
import { QueryProvider } from "@/lib/providers/query-provider";
|
|
import "../globals.css";
|
|
|
|
const nunitoSans = Nunito_Sans({
|
|
variable: "--font-nunito-sans",
|
|
subsets: ["latin"],
|
|
weight: ["200", "300", "400", "500", "600", "700", "800", "900"],
|
|
});
|
|
|
|
const geistMono = Geist_Mono({
|
|
variable: "--font-geist-mono",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
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",
|
|
},
|
|
};
|
|
}
|
|
|
|
export default async function LocaleLayout({
|
|
children,
|
|
params,
|
|
}: {
|
|
children: React.ReactNode;
|
|
params: Promise<{ locale: string }>;
|
|
}) {
|
|
const { locale } = await params;
|
|
const messages = await getMessages();
|
|
|
|
const baseUrl = "https://tibiatrade.evandro.dev.br";
|
|
|
|
return (
|
|
<html lang={locale} suppressHydrationWarning>
|
|
<head>
|
|
<link rel="icon" href="/favicon.ico" sizes="any" />
|
|
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
|
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
<script
|
|
type="application/ld+json"
|
|
dangerouslySetInnerHTML={{
|
|
__html: 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
|
|
type="application/ld+json"
|
|
dangerouslySetInnerHTML={{
|
|
__html: 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",
|
|
},
|
|
}),
|
|
}}
|
|
/>
|
|
</head>
|
|
<body
|
|
className={`${nunitoSans.variable} ${geistMono.variable} antialiased`}
|
|
>
|
|
<QueryProvider>
|
|
<NextIntlClientProvider messages={messages}>
|
|
<ThemeProvider attribute="class" defaultTheme="dark">
|
|
{children}
|
|
</ThemeProvider>
|
|
</NextIntlClientProvider>
|
|
</QueryProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|