Frontend/src/app/(pages)/page.tsx
Liam b978bc14df
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 58s
add more stats and add a tooltip to them
2024-04-18 02:31:52 +01:00

72 lines
2.1 KiB
TypeScript

import { Stats } from "@/app/components/stats";
import Link from "next/link";
import { ReactElement } from "react";
import { Button } from "../components/ui/button";
import { Separator } from "../components/ui/separator";
import { Tooltip, TooltipContent, TooltipTrigger } from "../components/ui/tooltip";
type Button = {
title: string;
tooltip: string;
url: string;
openInNewTab?: boolean;
};
const buttons: Button[] = [
{
title: "Get Started",
tooltip: "Click to view the Postman Collection",
url: "https://www.postman.com/imfascinated/workspace/minecraft-utilities",
openInNewTab: true,
},
{
title: "Documentation",
tooltip: "Click to open the documentation",
url: "https://api.mcutils.xyz/swagger-ui.html",
openInNewTab: true,
},
];
export default function Home(): ReactElement {
return (
<div className="text-center flex flex-col gap-4 mt-4">
<div>
<h1 className="text-4xl mb-2">Minecraft Utilities</h1>
<div className="text-lg">
<p>Minecraft Utilities offers you many endpoints to get information about a minecraft server or a player.</p>
<p>We offer you a simple and easy to use API.</p>
</div>
</div>
<div className="flex flex-row gap-2 justify-center mt-4">
{buttons.map((button, index) => {
return (
<Tooltip key={index}>
<TooltipTrigger asChild>
<Button key={index}>
<Link href={button.url} target={button.openInNewTab ? "_blank" : ""}>
<p>{button.title}</p>
</Link>
</Button>
</TooltipTrigger>
<TooltipContent>
<p>{button.tooltip}</p>
</TooltipContent>
</Tooltip>
);
})}
</div>
<Separator className="mt-6 mb-6" />
<div className="flex flex-col gap-4 items-center">
<div className="text-center">
<p className="font-semibold text-xl">API Statistics</p>
<p>View the statistics for the API in real-time!</p>
</div>
<Stats />
</div>
</div>
);
}