Files
PolyWeather/frontend/app/page.tsx
2026-06-14 05:11:37 +08:00

78 lines
2.5 KiB
TypeScript

import type { Metadata } from "next";
import { redirect } from "next/navigation";
import { InstitutionalLandingPage } from "@/components/landing/InstitutionalLandingPage";
import { LANDING_LOCALE_QUERY_PARAM } from "@/components/landing/landingLocale";
export const metadata: Metadata = {
title: "PolyWeather | Institutional Weather Signal Intelligence",
description:
"PolyWeather is a paid professional weather-signal intelligence terminal with METAR evidence, DEB forecast blending, and structured decision context.",
other: {
preconnect: "https://api.polyweather.top",
},
};
export default async function HomePage({
searchParams,
}: {
searchParams: Promise<Record<string, string | string[] | undefined>>;
}) {
const params = await searchParams;
const code = params.code;
if (typeof code === "string" && code.trim()) {
const usp = new URLSearchParams();
for (const [key, value] of Object.entries(params)) {
if (value != null) {
if (Array.isArray(value)) {
for (const v of value) usp.append(key, v);
} else {
usp.set(key, value);
}
}
}
const qs = usp.toString();
redirect(`/auth/callback${qs ? `?${qs}` : ""}`);
}
const rawLandingLocale = params[LANDING_LOCALE_QUERY_PARAM];
const landingLocale = Array.isArray(rawLandingLocale) ? rawLandingLocale[0] : rawLandingLocale;
const jsonLd = {
"@context": "https://schema.org",
"@type": "WebApplication",
name: "PolyWeather",
description:
"Paid professional weather-signal intelligence terminal with METAR evidence, DEB forecast blending, and structured decision context.",
url: "https://polyweather.top",
applicationCategory: "BusinessApplication",
operatingSystem: "Web",
offers: [
{
"@type": "Offer",
name: "Pro monthly",
price: "29.90",
priceCurrency: "USD",
description:
"Pro subscription for 30 days. Referral users pay 20.00 USD-equivalent USDC for the first month.",
availability: "https://schema.org/InStock",
},
{
"@type": "Offer",
name: "Pro quarterly",
price: "79.90",
priceCurrency: "USD",
description: "Pro subscription for 90 days.",
availability: "https://schema.org/InStock",
},
],
};
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<InstitutionalLandingPage queryLocale={landingLocale} />
</>
);
}