diff --git a/Frontend/public/media/platform/bedrock.png b/Frontend/public/media/platform/bedrock.png new file mode 100644 index 0000000..4b4feb8 Binary files /dev/null and b/Frontend/public/media/platform/bedrock.png differ diff --git a/Frontend/public/media/platform/java.png b/Frontend/public/media/platform/java.png new file mode 100644 index 0000000..3036471 Binary files /dev/null and b/Frontend/public/media/platform/java.png differ diff --git a/Frontend/src/app/(pages)/server/[[...slug]]/page.tsx b/Frontend/src/app/(pages)/server/[[...slug]]/page.tsx index 20dfafd..1498623 100644 --- a/Frontend/src/app/(pages)/server/[[...slug]]/page.tsx +++ b/Frontend/src/app/(pages)/server/[[...slug]]/page.tsx @@ -16,6 +16,7 @@ import { type RestfulMCAPIError, ServerPlatform, } from "restfulmc-lib"; +import ServerRecommendations from "@/components/server/server-recommendations"; /** * The page to lookup a server. @@ -43,38 +44,43 @@ const ServerPage = async ({ params }: PageProps): Promise => { // Render the page return ( -
+
-

- Server Lookup -

+ {/* Header */} +
+

+ Server Lookup +

-
- {/* Error */} - {error && ( - - - Error - {error} - - )} +
+ {/* Error */} + {error && ( + + + Error + {error} + + )} - {/* Search */} - -
- - {/* Server Result */} - {result && ( -
- + {/* Search */} +
- )} +
+ + {/* Server Result & Recommendations */} + {result ? ( +
+ +
+ ) : ( + + )}
); }; diff --git a/Frontend/src/app/components/server/server-recommendations.tsx b/Frontend/src/app/components/server/server-recommendations.tsx new file mode 100644 index 0000000..f61c2e5 --- /dev/null +++ b/Frontend/src/app/components/server/server-recommendations.tsx @@ -0,0 +1,66 @@ +import { ReactElement } from "react"; +import { cn } from "@/lib"; +import { minecrafter } from "@/font/fonts"; +import { ServerPlatform } from "restfulmc-lib"; +import { Button } from "@/components/ui/button"; +import Image from "next/image"; +import Link from "next/link"; + +/** + * The recommendations for a server. + */ +const RECOMMENDATIONS: { + [hostname: string]: ServerPlatform; +} = { + "hypixel.net": ServerPlatform.JAVA, + "cubecraft.net": ServerPlatform.JAVA, + "wildprison.net": ServerPlatform.JAVA, + "wildprison.bedrock.minehut.gg": ServerPlatform.BEDROCK, + "play.lbsg.net": ServerPlatform.BEDROCK, +}; + +/** + * The recommendations for + * a server to test. + * + * @return the recommendations jsx + */ +const ServerRecommendations = (): ReactElement => ( +
+ {/* Header */} +

+ Try A Server +

+ + {/* Recommendations */} +
+ {Object.entries(RECOMMENDATIONS).map( + ( + [hostname, platform]: [string, ServerPlatform], + index: number + ): ReactElement => ( + + + + ) + )} +
+
+); +export default ServerRecommendations; diff --git a/Frontend/src/app/components/ui/button.tsx b/Frontend/src/app/components/ui/button.tsx index 7bf9602..43b2c3c 100644 --- a/Frontend/src/app/components/ui/button.tsx +++ b/Frontend/src/app/components/ui/button.tsx @@ -14,7 +14,7 @@ const buttonVariants = cva( destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", + "border border-zinc-700 bg-transparent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground",