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

52 lines
1.5 KiB
TypeScript
Raw Normal View History

2024-04-14 19:01:57 +01:00
import Link from "next/link";
2024-04-17 18:08:13 +01:00
import { Button } from "../components/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "../components/ui/tooltip";
2024-04-14 19:01:57 +01:00
type Button = {
title: string;
2024-04-17 18:08:13 +01:00
tooltip: string;
2024-04-14 19:01:57 +01:00
url: string;
2024-04-17 18:08:13 +01:00
openInNewTab?: boolean;
2024-04-14 19:01:57 +01:00
};
const buttons: Button[] = [
2024-04-17 18:08:13 +01:00
{ title: "Get Started", tooltip: "Click to get open the player page", url: "/player" },
{
title: "Documentation",
tooltip: "Click to open the documentation",
url: "https://api.mcutils.xyz/swagger-ui.html",
openInNewTab: true,
},
2024-04-14 19:01:57 +01:00
];
2024-04-16 21:18:08 +01:00
export default function Home(): JSX.Element {
2024-04-14 17:45:04 +01:00
return (
2024-04-14 19:01:57 +01:00
<div className="text-center flex flex-col justify-center">
2024-04-15 12:12:24 +01:00
<h1 className="text-4xl mb-2">Minecraft Utilities</h1>
2024-04-14 19:55:07 +01:00
<div className="text-lg">
<p>Minecraft Utilities offers you many endpoints to get information about a minecraft server or a player.</p>
2024-04-16 22:05:36 +01:00
<p>We offer you a simple and easy to use API.</p>
2024-04-14 19:55:07 +01:00
</div>
2024-04-14 19:01:57 +01:00
2024-04-14 19:55:07 +01:00
<div className="mt-6 flex flex-row gap-2 justify-center">
2024-04-14 19:01:57 +01:00
{buttons.map((button, index) => {
return (
2024-04-17 18:08:13 +01:00
<Tooltip key={index}>
<TooltipTrigger>
<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 19:01:57 +01:00
);
})}
</div>
2024-04-14 18:46:37 +01:00
</div>
2024-04-14 17:45:04 +01:00
);
}