Frontend/src/app/(pages)/page.tsx

72 lines
2.1 KiB
TypeScript
Raw Normal View History

2024-04-14 18:01:57 +00:00
import Link from "next/link";
2024-04-17 17:08:13 +00:00
import { Button } from "../components/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "../components/ui/tooltip";
2024-04-18 00:37:59 +00:00
import { Separator } from "../components/ui/separator";
2024-04-18 00:21:38 +00:00
import { ReactElement } from "react";
2024-04-18 00:37:59 +00:00
import { Stats } from "@/app/components/stats";
2024-04-14 18:01:57 +00:00
type Button = {
title: string;
2024-04-17 17:08:13 +00:00
tooltip: string;
2024-04-14 18:01:57 +00:00
url: string;
2024-04-17 17:08:13 +00:00
openInNewTab?: boolean;
2024-04-14 18:01:57 +00:00
};
const buttons: Button[] = [
{
title: "Get Started",
tooltip: "Click to view the Postman Collection",
url: "https://www.postman.com/imfascinated/workspace/minecraft-utilities",
openInNewTab: true,
},
2024-04-17 17:08:13 +00:00
{
title: "Documentation",
tooltip: "Click to open the documentation",
url: "https://api.mcutils.xyz/swagger-ui.html",
openInNewTab: true,
},
2024-04-14 18:01:57 +00:00
];
2024-04-18 00:21:38 +00:00
export default function Home(): ReactElement {
2024-04-14 16:45:04 +00:00
return (
2024-04-18 00:37:59 +00:00
<div className="text-center flex flex-col gap-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>
2024-04-14 18:55:07 +00:00
</div>
2024-04-14 18:01:57 +00:00
2024-04-18 00:48:30 +00:00
<div className="flex flex-row gap-2 justify-center mt-4">
2024-04-14 18:01:57 +00:00
{buttons.map((button, index) => {
return (
2024-04-17 17:08:13 +00:00
<Tooltip key={index}>
<TooltipTrigger asChild>
2024-04-17 17:08:13 +00:00
<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>
2024-04-14 18:01:57 +00:00
);
})}
</div>
2024-04-18 00:37:59 +00:00
<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>
2024-04-14 17:46:37 +00:00
</div>
2024-04-14 16:45:04 +00:00
);
}