2024-04-18 02:31:52 +01:00
|
|
|
import { Stats } from "@/app/components/stats";
|
2024-04-14 19:01:57 +01:00
|
|
|
import Link from "next/link";
|
2024-04-18 02:31:52 +01:00
|
|
|
import { ReactElement } from "react";
|
2024-04-17 18:08:13 +01:00
|
|
|
import { Button } from "../components/ui/button";
|
2024-04-18 01:37:59 +01:00
|
|
|
import { Separator } from "../components/ui/separator";
|
2024-04-18 02:31:52 +01:00
|
|
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../components/ui/tooltip";
|
2024-04-19 22:08:20 +01:00
|
|
|
import { Title } from "@/app/components/title";
|
2024-04-14 19:01:57 +01:00
|
|
|
|
|
|
|
type Button = {
|
2024-04-18 07:06:16 +01:00
|
|
|
/**
|
|
|
|
* The title of the button.
|
|
|
|
*/
|
2024-04-14 19:01:57 +01:00
|
|
|
title: string;
|
2024-04-18 07:06:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The tooltip to display for this statistic.
|
|
|
|
*/
|
2024-04-17 18:08:13 +01:00
|
|
|
tooltip: string;
|
2024-04-18 07:06:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The URL to go to.
|
|
|
|
*/
|
2024-04-14 19:01:57 +01:00
|
|
|
url: string;
|
2024-04-18 07:06:16 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether clicking the button will
|
|
|
|
* open the link in a new tab.
|
|
|
|
*/
|
2024-04-17 18:08:13 +01:00
|
|
|
openInNewTab?: boolean;
|
2024-04-20 14:43:37 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The class name to apply to the button.
|
|
|
|
*/
|
|
|
|
className?: string;
|
2024-04-14 19:01:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
const buttons: Button[] = [
|
2024-04-17 19:06:26 +01:00
|
|
|
{
|
|
|
|
title: "Get Started",
|
2024-04-20 14:43:37 +01:00
|
|
|
tooltip: "Click to get started with the API",
|
2024-04-20 00:34:42 +01:00
|
|
|
url: "/documentation",
|
2024-04-20 14:43:37 +01:00
|
|
|
className: "bg-gradient-to-r from-indigo-500 to-emerald-500 px-7 hover:opacity-75 transition-all transform-gpu",
|
2024-04-17 18:08:13 +01:00
|
|
|
},
|
2024-04-14 19:01:57 +01:00
|
|
|
];
|
|
|
|
|
2024-04-18 01:21:38 +01:00
|
|
|
export default function Home(): ReactElement {
|
2024-04-14 17:45:04 +01:00
|
|
|
return (
|
2024-04-18 02:54:16 +01:00
|
|
|
<div className="text-center flex flex-col gap-4">
|
2024-04-19 22:08:20 +01:00
|
|
|
<div className="p-2">
|
|
|
|
<Title
|
|
|
|
title="Minecraft Utilities"
|
|
|
|
subtitle={
|
|
|
|
<>
|
|
|
|
<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>
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
/>
|
2024-04-14 19:01:57 +01:00
|
|
|
|
2024-04-19 15:53:24 +01:00
|
|
|
<div className="flex flex-row gap-2 justify-center mt-4 flex-wrap">
|
2024-04-18 02:54:16 +01:00
|
|
|
{buttons.map((button, index) => {
|
|
|
|
return (
|
|
|
|
<Tooltip key={index}>
|
|
|
|
<TooltipTrigger asChild>
|
2024-04-20 14:43:37 +01:00
|
|
|
<Button key={index} className={button.className ? button.className : ""}>
|
2024-04-18 02:54:16 +01:00
|
|
|
<Link href={button.url} target={button.openInNewTab ? "_blank" : ""}>
|
|
|
|
<p>{button.title}</p>
|
|
|
|
</Link>
|
|
|
|
</Button>
|
|
|
|
</TooltipTrigger>
|
|
|
|
<TooltipContent>
|
|
|
|
<p>{button.tooltip}</p>
|
|
|
|
</TooltipContent>
|
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
</div>
|
2024-04-14 19:01:57 +01:00
|
|
|
</div>
|
2024-04-18 01:37:59 +01:00
|
|
|
|
2024-04-18 02:54:16 +01:00
|
|
|
<Separator />
|
2024-04-18 01:37:59 +01:00
|
|
|
|
2024-04-19 22:08:20 +01:00
|
|
|
<div className="flex flex-col gap-4 items-center p-2">
|
2024-04-18 01:37:59 +01:00
|
|
|
<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 18:46:37 +01:00
|
|
|
</div>
|
2024-04-14 17:45:04 +01:00
|
|
|
);
|
|
|
|
}
|