This commit is contained in:
parent
b9205cbdb6
commit
1a0d9afb82
@ -1,13 +1,10 @@
|
||||
import AnalyticsChart from "@/components/AnalyticsChart";
|
||||
import Card from "@/components/Card";
|
||||
import Container from "@/components/Container";
|
||||
|
||||
import { ScoresaberPlayerCountHistory } from "@/schemas/fascinated/scoresaberPlayerCountHistory";
|
||||
import { ssrSettings } from "@/ssrSettings";
|
||||
import { Metadata } from "next";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Search",
|
||||
};
|
||||
|
||||
async function getData() {
|
||||
const response = await fetch(
|
||||
"https://bs-tracker.fascinated.cc/analytics?time=30d",
|
||||
@ -19,7 +16,26 @@ async function getData() {
|
||||
);
|
||||
|
||||
const json = await response.json();
|
||||
return json;
|
||||
return json as ScoresaberPlayerCountHistory;
|
||||
}
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const data = await getData();
|
||||
|
||||
const description = "View Scoresaber metrics and statistics over time.";
|
||||
|
||||
return {
|
||||
title: `Analytics`,
|
||||
description: description,
|
||||
openGraph: {
|
||||
siteName: ssrSettings.siteName,
|
||||
title: `Analytics`,
|
||||
description:
|
||||
description +
|
||||
`
|
||||
Players currently online: ${data.history[data.history.length - 1].value}`,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default async function Analytics() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user