diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index a8aaefa..0000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": ["next/core-web-vitals"],
- "rules": {
- "react-hooks/exhaustive-deps": "off",
- "react/no-unescaped-entities": "off",
- "react/display-name": "off"
- }
-}
diff --git a/.gitignore b/.gitignore
index 36a6e5e..13a2492 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,48 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-# dependencies
-/node_modules
-/.pnp
+# Dependencies
+node_modules
+.pnp
.pnp.js
-.yarn/install-state.gz
+
+# Local env files
+.env
+apps/www/.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+# Testing
+coverage
+
+# Turbo
.turbo
-# contentlayer
-.contentlayer
+# Vercel
+.vercel
-# cron
-/cron/dist
-/cron/node_modules
+# Build Outputs
+.next/
+out/
+build
+dist
-# testing
-/coverage
-# next.js
-/.next/
-/out/
-
-# production
-/build
-
-# misc
-.DS_Store
-*.pem
-
-# debug
+# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-# local env files
-.env*.local
-
-# vercel
-.vercel
-
-# typescript
-*.tsbuildinfo
-next-env.d.ts
-
-css-obfuscator
-
-*.sync-conflict*
\ No newline at end of file
+# Misc
+.DS_Store
+*.pem
diff --git a/.idea/.gitignore b/.idea/.gitignore
index 88bf7a7..13566b8 100644
--- a/.idea/.gitignore
+++ b/.idea/.gitignore
@@ -1,8 +1,8 @@
-# Ignore everything for IntelliJ except for project essential code-styles
-*
-
-!copyright/*
-!codeStyles/*
-!.gitignore
-
-!*/
\ No newline at end of file
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/MHSF-Modern.iml b/.idea/MHSF-Modern.iml
new file mode 100644
index 0000000..24643cc
--- /dev/null
+++ b/.idea/MHSF-Modern.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 5dcac8f..0000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index 79ee123..0000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/copyright/MIT_License_f__MHSF.xml b/.idea/copyright/MIT_License_f__MHSF.xml
index 2813261..77536ee 100644
--- a/.idea/copyright/MIT_License_f__MHSF.xml
+++ b/.idea/copyright/MIT_License_f__MHSF.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
index a915e37..2ebca56 100644
--- a/.idea/copyright/profiles_settings.xml
+++ b/.idea/copyright/profiles_settings.xml
@@ -1,3 +1,7 @@
-
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..03d9549
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..3bd27f7
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..c94970a
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..e69de29
diff --git a/.tool-versions b/.tool-versions
deleted file mode 100644
index e2a1032..0000000
--- a/.tool-versions
+++ /dev/null
@@ -1 +0,0 @@
-nodejs 23.3.0
diff --git a/.vercelignore b/.vercelignore
deleted file mode 100644
index 465c6c3..0000000
--- a/.vercelignore
+++ /dev/null
@@ -1,2 +0,0 @@
-backend-mh-api/
-cron/
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
index e4ad59b..e68acd7 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,3 +1,3 @@
{
- "copyright-header-injector.copyrightText": "/*\n * MHSF, Minehut Server List\n * All external content is rather licensed under the ECA Agreement\n * located here: https://mhsf.app/docs/legal/external-content-agreement\n *\n * All code under MHSF is licensed under the MIT License\n * by open source contributors\n *\n * Copyright (c) 2024 dvelo\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */"
+ "copyright-header-injector.copyrightText": "/*\n * MHSF, Minehut Server List\n * All external content is rather licensed under the ECA Agreement\n * located here: https://mhsf.app/docs/legal/external-content-agreement\n *\n * All code under MHSF is licensed under the MIT License\n * by open source contributors\n *\n * Copyright (c) 2025 dvelo\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */"
}
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index d5a32ef..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2024 dvelo
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/backend-mh-api/src/index.ts b/backend-mh-api/src/index.ts
deleted file mode 100644
index a2ab335..0000000
--- a/backend-mh-api/src/index.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import * as express from "express";
-import { config } from "dotenv";
-
-config();
-const app = express();
-
-app.get("/", (req, res) => {
- res.send({ status: "up" });
-});
-
-app.get("/servers", (req, res) => {
- if (
- req.headers.Authentication !==
- `MHSF-Backend-Server ${process.env.MHSF_SECRET}`
- )
- res.status(401).send({ error: "Unauthorized" });
- else
- fetch("https://api.minehut.com/servers").then((c) => {
- c.json().then((v) => {
- res.send(v);
- });
- });
-});
-
-app.listen(6080, () => {
- console.log("Backend API listening on port 6080");
-});
diff --git a/biome.json b/biome.json
deleted file mode 100644
index faa0495..0000000
--- a/biome.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
- "linter": {
- "rules": {
- "style": {
- "useTemplate": "off",
- "useImportType": "warn"
- },
- "suspicious": {
- "noExplicitAny": "off",
- "noDoubleEquals": "warn"
- },
- "complexity": {
- "noForEach": "off"
- }
- }
- }
-}
diff --git a/components.json b/components.json
deleted file mode 100644
index 59e0a29..0000000
--- a/components.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "$schema": "https://ui.shadcn.com/schema.json",
- "style": "new-york",
- "rsc": true,
- "tsx": true,
- "tailwind": {
- "config": "tailwind.config.ts",
- "css": "src/app/globals.css",
- "baseColor": "slate",
- "cssVariables": true,
- "prefix": ""
- },
- "aliases": {
- "components": "@/components",
- "utils": "@/lib/utils"
- }
-}
diff --git a/contentlayer.config.js b/contentlayer.config.js
deleted file mode 100755
index c45fc27..0000000
--- a/contentlayer.config.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { defineDocumentType, makeSource } from "contentlayer/source-files";
-import rehypeSlug from "rehype-slug";
-import GithubSlugger from "github-slugger";
-
-export const Docs = defineDocumentType(() => ({
- name: "Docs",
- filePathPattern: `**/*.mdx`,
- contentType: "mdx",
- fields: {
- title: {
- type: "string",
- required: true,
- },
- folder: {
- type: "string",
- required: false,
- },
- lastUpdated: {
- type: "string",
- required: false,
- },
- },
- computedFields: {
- url: {
- type: "string",
- resolve: (docs) => `/docs/${docs._raw.flattenedPath}`,
- },
- toc: {
- type: "json",
- resolve: async (doc) => {
- const headingsRegex = /\n(?#{1,6})\s+(?.+)/g;
- const slugger = new GithubSlugger();
- const headings = Array.from(doc.body.raw.matchAll(headingsRegex)).map(
- ({ groups }) => {
- const flag = groups?.flag;
- const content = groups?.content;
- return {
- level: flag.length,
- text: content,
- slug: content ? slugger.slug(content) : undefined,
- };
- },
- );
- return headings;
- },
- },
- },
-}));
-
-export default makeSource({
- contentDirPath: "docs",
- documentTypes: [Docs],
- mdx: { rehypePlugins: [rehypeSlug] },
-});
diff --git a/docs/advanced/achievements.mdx b/docs/advanced/achievements.mdx
deleted file mode 100644
index 7d6aee1..0000000
--- a/docs/advanced/achievements.mdx
+++ /dev/null
@@ -1,34 +0,0 @@
----
-title: "Achievement Collection"
-folder: "Advanced"
----
-
-import { formalNames } from "@/config/achievements"
-
-# Achievements
-Achievements are a page that every server gets which contains certain requirements which could be embedded in an servers history.
-
-
-
-These achievements are accessable using the "Achievements" tab on the left of any server page.
-Achievements are *not* collected instantly, and are collected every 12 hours when the server is online (this is not timezone dependent).
-There are currently {Object.keys(formalNames).length} possible achievements to get, ranging from easiest to hardest.
-
-## 1 thousand favorites achievement
-After getting 1 thousand favorites on MHSF, and your server is online during the achievement collection, *you will get this achievement showing* when you got **1,000 users to favorite your server**.
-
-
-## 1 thousand total joins achievement
-After getting 1 thousand total joins on Minehut, and your server is online during the achievement collection, *you will get this achievement showing* when you got **1,000 users to join your server**.
- Here is a preview:
-
-
-## 100 thousand favorites achievement
-After getting 100 thousand favorites on MHSF, and your server is online during the achievement collection, *you will get this achievement showing* when you got **100 thousand users to favorite your server**.
- Here is a preview:
-
-
-## 100 thousand total joins achievement
-After getting 100 thousand total joins on Minehut, and your server is online during the achievement collection, *you will get this achievement showing* when you got **100 thousand users to join your server**.
- Here is a preview:
-
\ No newline at end of file
diff --git a/docs/advanced/command-bar.mdx b/docs/advanced/command-bar.mdx
deleted file mode 100644
index 21406ab..0000000
--- a/docs/advanced/command-bar.mdx
+++ /dev/null
@@ -1,35 +0,0 @@
----
-title: "Using the Command-bar"
-folder: "Advanced"
----
-
-# Using the Command-bar
-
-The command-bar has many mods and is a great tool for power-users to use as its built to be fast, while showing optimal information to the scenario
-
-
-
-## Triggering the command-bar
-
-There are two ways to trigger the command bar, using `Ctrl+K` and Ctrl + Shift + K. Both put you in a command-bar, however when using `Ctrl+K`, you go into a general page with other settings.
-Using Ctrl + Shift + K opens a server viewer, and this may be faster then going through the general page.
-
-## Functions using Ctrl+K
-
-- **Servers** opens a server list, same as Ctrl + Shift + K
-- **Sort Servers** allows you to go into a sorted server list quickly
-- **Links** shows links useful for MHSF
-- **Pick Random Server** picks a random server and shows the user what that server is, is similar to the one on [the server list](/)
-
- **Profile (requires log-in):**
-- **Favorites** shows the user their favorited servers
-- **User Settings** shows the user the settings for Clerk
-
-## Servers
-
-This view shows the most popular 50 servers, and when searching, you can search for any server that exists (offline or online).
-When clicking on a server, you see a simple view showing information about the server, along with a link to the server page.
-
-## Trigger from information popover
-
-Click the top-right info button, and click Open Commands. This will open the same `Ctrl+K` command-bar, if you would like to use it on mobile.
diff --git a/docs/advanced/external.mdx b/docs/advanced/external.mdx
deleted file mode 100644
index bccd615..0000000
--- a/docs/advanced/external.mdx
+++ /dev/null
@@ -1,94 +0,0 @@
----
-title: "Troubleshooting: Making external servers on Minehut"
-folder: "Advanced"
----
-
-# External Servers on Minehut
-I think creating external servers on Minehut is an advanced subject, and it is not documented well enough for the circumstances that
-might occur with server owners. This is a [extension/rephrasing of the offical wiki guide](Wiki:External). All points in **bold** are things you shouldn't miss, and are commonly misread.
-
-
-
-_Note: This is an unoffical guide, but the offical way of connecting! This is safe!_
-## Getting started
-You must pick a host that allows the following when making external servers:
- - **Editing server flags** Editing flags for the server to run is essential. There are many cases where you were not able to continue because your provider was resetting your flags back
- - **A supported server software** For standalone servers, you must run on [Paper](https://papermc.io/software/paper). For proxy networks, you can use [Velocity](https://velocitypowered.com/), [Waterfall](https://papermc.io/software/waterfall) & [Lilypad](https://www.lilypadmc.org/). **BungeeCord is not supported by any means!**
-
-Minehut offically recommends Velocity, which you can find instructions [here](https://docs.papermc.io/velocity/getting-started) to get going! If you do not wish to use a proxy, using Paper is recommended, which you can find a guide [here](https://docs.papermc.io/paper/getting-started).
-Before doing below, **make sure your proxy _actually works!_**
-
-## Changing flags
-To ensure that Minehut can properly connect your players to your server, you need to add flags when booting up your server. These are commonly in `start.bat` or `start.sh` for Linux-based hosts. **Players cannot join your server from Minehut without adding these flags!**
-
-
-### Velocity
-Add the following `sessionserver` flag to your start script:
- ```
- -Dmojang.sessionserver=https://api.minehut.com/mitm/proxy/session/minecraft/hasJoined
- ```
- All flags put together should look like the following:
- ```
- java -Dmojang.sessionserver=https://api.minehut.com/mitm/proxy/session/minecraft/hasJoined -jar velocity.jar
- ```
-
-### Paper - standalone
- Like said above, if you run a proxy, add the flags for Velocity. **Adding both the Velocity (or any other proxy server) & Paper flags will cause your server to be unauthenticatable!**
- Add the following `auth.host`, `account.host`, `services.host` & `session.host` flags:
- ```
- -Dminecraft.api.auth.host=https://authserver.mojang.com/
- -Dminecraft.api.account.host=https://api.mojang.com/
- -Dminecraft.api.services.host=https://api.minecraftservices.com/
- -Dminecraft.api.session.host=https://api.minehut.com/mitm/proxy
- ```
- All the script together
- ```
- java -Dminecraft.api.auth.host=https://authserver.mojang.com/ -Dminecraft.api.account.host=https://api.mojang.com/ -Dminecraft.api.services.host=https://api.minecraftservices.com/ -Dminecraft.api.session.host=https://api.minehut.com/mitm/proxy -jar paper.jar
- ```
- **Along with this,** make sure to set the `enforce-secure-profile` flag in the `server.properties` file to `false`.
- ```
- enable-status=true
- # Set this to false!
- enforce-secure-profile=false
- enforce-whitelist=false
- ```
-
-
-### Lilypad
-Set the following environment variable `LILYPAD_MOJANG_SESSIONSERVER_URL` to `https://api.minehut.com/mitm/proxy/session/minecraft/hasJoined`. Environment variables are set as a seperate command in the start script:
-```
-LILYPAD_MOJANG_SESSIONSERVER_URL="https://api.minehut.com/mitm/proxy/session/minecraft/hasJoined"
-```
-If above doesn't work, try this:
-```
-export LILYPAD_MOJANG_SESSIONSERVER_URL="https://api.minehut.com/mitm/proxy/session/minecraft/hasJoined"
-```
-
-## Enable Proxy Protocol
-_Note: Skip this step if you're using [TCPShield](https://tcpshield.com/) for DDoS protection._
-
-Enable proxy protocol in your proxy's configuration file:
-### Velocity
-
-In `velocity.toml` under advanced, set
-```
-haproxy-protocol = true
-```
-### Waterfall
-
-In `config.yml` under listeners, set
-```
-proxy_protocol: true
-```
-### Paper
-
-In `config/paper-global.yml` under proxies, set
-```
-proxy-protocol: true
-```
-
-## Thats it!
-After this, there are mostly no more common issues. Continue on [the wiki](Wiki:External#Connect_Your_External_Server_Plan_on_Minehut)!
-
-## Have any issues?
-Go to the offical Minehut Discord server and go into the [#ask-for-help](https://discord.com/channels/239599059415859200/1014801630295760897) channel and create a thread.
\ No newline at end of file
diff --git a/docs/advanced/tech-stack.mdx b/docs/advanced/tech-stack.mdx
deleted file mode 100644
index f8768cc..0000000
--- a/docs/advanced/tech-stack.mdx
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: "Tech-stack"
-folder: "Advanced"
----
-
-# Teck Stack of MHSF
-The tech stack of MHSF is relatively modern to ensure MHSF keeps up with standards set for accessibility and usability.
-
-## Front-end
-- **React** is used as a way to replicate components already used, and use the eco-system of pre-existing components
-- **shadcn/ui** is the UI framework used to keep the whole website consistent.
-- **Contentlayer** manages all the pages used for documentation
-- **TailwindCSS** makes MHSF use (mostly) no CSS for better efficency
-- **Sonner** provides the Toast used for MHSF
-
-## Back-end
-- **Inngest** runs periodic tasks
-- **MongoDB** is the database of choice for MHSF
-
-## Both
-- **Clerk** is used for authentication of users
-- **Next.js** is used to make sure API endpoints and front-end endpoints are on the same domain, along with lots of convient features
-- **Vercel** is hosting MHSF (along with non-tracking analytics)
-
diff --git a/docs/getting-started.mdx b/docs/getting-started.mdx
deleted file mode 100644
index b91b255..0000000
--- a/docs/getting-started.mdx
+++ /dev/null
@@ -1,31 +0,0 @@
----
-title: "Getting Started"
----
-
-# Getting Started to MHSF
-
-MHSF is an open-source wrapper for the traditional Minehut server list, either in the lobby or the one [built-in to the minehut.com website directly](https://app.minehut.com/servers).
-The way MHSF communicates with Minehut is using the closed Minehut API discovered by using DevTools on the original Minehut page.
-Along with this, there are entries that are completely third-party like for adding descriptions or banners.
-
-## What is a wrapper?
-
-Wrappers are usually free & open-source software that goes on-top of existing software that may be proprietary. There are many reasons for a wrapper to exist (privacy, automation, etc.), in MHSF's case, its because the Minehut server list provided by default just doesn't cut it.
-Wrappers usually communicate using an API that was provided by the service its self, making software like MHSF completely legal.
-
-## Why to use MHSF
-
-- **Faster response times** MHSF is completely ad-free, and as a result of being open-source, constantly tries to cut down on unnecessary things slowing down the page.
-- **Open-source & no tracking** As a result of being open-source, MHSF will never track or sell your data to advertisers. Anybody can look at the code, and can be verified to be completely secure.
-- **Make your server stand out** Server owners can configure after appropriate verification banners, Discord widgets, descriptions & color schemes.
-- **Customize your experience** Filters, sorts & different spacing settings can make your experience just how you like it while you are browsing servers.
-- **Better & more intuitive UX/UI** UI is a big point for MHSF, using UI designed to be more user friendly, and to be more straight-forward then Minehut's
-- **One focus** Because MHSF is only a server-list, it only has to be, _a server list!_ This means more updates and higher quality ones because all MHSF has to worry about, is the server list!
-
-## Will you get banned for this?
-
-No. Your Minehut account is not associated with your MHSF one, and consequently, you cannot be banned. There is no risk of getting banned by Minehut, as we are posing no threat to them. As long as you aren't spamming MHSF (or the API in general), you should be good.
-
-## Conclusion
-
-If you'd like to use MHSF, go to the server list [here](Special:Root) to try it out! You may also give MHSF a star on GitHub if you feel like this project deserves it.
diff --git a/docs/guides/customization.mdx b/docs/guides/customization.mdx
deleted file mode 100644
index 5f16cae..0000000
--- a/docs/guides/customization.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: "Customization"
-folder: "Guides"
----
-
-# Customize your server
-Customizing your server is very easy after you have [linked your account](Docs:guides/linking). Make sure you have done that before then.
-
-## Getting started
-Make sure you've also [owned your server](Docs:guides/owning-a-server).
-
-## Customization Types
-### Discord Server
-Enable the server widget in your Discord server settings, and copy and paste in the Discord server ID, and your Discord server will appear!
-
-### Banner
-Your server must have an image from [Imgur](https://imgur.com), and can be any image type that can be rendered on the web. Copy and paste the link (not the link after uploading the image, but by right clicking and hitting "Copy Image Address") into the input box!
-
-### Color Scheme
-You can pick any color in the box and choosing a color scheme to show on your server specificly.
-
-### Description
-You can use Markdown formatting to add a description to describe what your server is.
-
-## Thats it!
-If you have additional customization types or other things you'd like us to add, [feel free to hit us with an issue on GitHub!](Special:GitHub)
\ No newline at end of file
diff --git a/docs/guides/linking.mdx b/docs/guides/linking.mdx
deleted file mode 100644
index f5d0c5c..0000000
--- a/docs/guides/linking.mdx
+++ /dev/null
@@ -1,29 +0,0 @@
----
-title: "Linking your account"
-folder: "Guides"
----
-
-# Linking your Minecraft account
-
-MHSF uses a safe & secure system to link your account that **doesn't use your Microsoft account in any way**. MHSF uses a simple system of logging into a server, and then putting a code into the website.
-
-
-
-## Prerequisites
-
-- An active account with MHSF (either linked through GitHub or Discord, or just a standard email account)
-- A Minecraft Java Edition account (Bedrock accounts are not guaranteed to work, and could malfunction at some times)
-
-## Linking
-
-To get started, go into your account settings (your profile picture in top-right, and Profile & Security) and click Link Account.
-Login to the server `MHSFPV.minehut.gg`. (its on a free plan, you may have to start it in the lobby) Take the code shown in chat, and put it into the OTP box. Hit Submit, and if the code is correct, your account will be linked! Congratulations!
-
-## Functions
-
-You can do many things with a linked account:
-
-- [Own a server](Docs:guides/owning-a-server)
-- [Customize a server](Docs:guides/customization)
-
-More will be coming in future updates, however the only thing you can do with a linked account is server-based functions.
diff --git a/docs/guides/owning-a-server.mdx b/docs/guides/owning-a-server.mdx
deleted file mode 100644
index 702f0df..0000000
--- a/docs/guides/owning-a-server.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: "Own a server"
-folder: "Guides"
----
-
-# Owning a server
-
-Owning a server is quite simple and allows you to [customize your server](/docs/guides/customization) and make it stand out from other servers. Before owning your server, make sure you agree to the [ECA](Docs:legal/external-content-agreement).
-
-## Linking
-
-Find the server you would like to own (either by looking for it, or using the keyboard shortcut Ctrl+Shift+K and searching for it), and make sure your account has [already been linked with your Minecraft account](Docs:guides/linking). Go to the server, and hit the Customization tab. If the owner of the server, and the user your linked to match, you will gain access to the server.
-If they match, you should see a button named Click to own. Press that button, and you should automagically own the server. Congratulations!
-
-## I can't link my server, because my server doesn't have a author
-
-Your server must have an author in-order to be automagically linked, and if it doesn't have an author, that means you will have to manually link your server. To do that, make an issue on GitHub, showing that your server has no author, but needs to be linked. Show proof that you own the server, along with your account username, and your account will own the server you need.
-
-## There is an error while linking my server!
-This most likely is because the Minehut API is blocking the server-side request to verify your the owner of that server, or your server [has no author](#i-cant-link-my-server-because-my-server-doesnt-have-a-author).
-Try again in 30 minute intervals, or just make an issue on GitHub to link your server.
\ No newline at end of file
diff --git a/docs/guides/reporting-server.mdx b/docs/guides/reporting-server.mdx
deleted file mode 100644
index 394ff81..0000000
--- a/docs/guides/reporting-server.mdx
+++ /dev/null
@@ -1,13 +0,0 @@
----
-title: "Reporting a server"
-folder: "Guides"
----
-
-# Reporting a server
-
-If you believe a server that you've seen is under breach of the [ECA Agreement](Docs:legal/external-content-agreement), you may request the server in question to be taken down.
-Make sure you are logged into a account, and go to the server page and hit the customization tab. Hit the Report button, and add a reason to your report.
-Your report will be processed and the appropriate action will be taken.
-
-## Issue inside the server
-If an issue is inside of the server, because MHSF doesn't provide the server list source (Minehut API), you must [go to Minehut and make a ticket](https://support.minehut.com/hc/en-us/requests/new?tf_subject=Reporting%20Server&tf_27062997154195=reports_appeals&tf_27063229498259=report_server).
\ No newline at end of file
diff --git a/docs/legal/external-content-agreement.mdx b/docs/legal/external-content-agreement.mdx
deleted file mode 100644
index 8a322db..0000000
--- a/docs/legal/external-content-agreement.mdx
+++ /dev/null
@@ -1,51 +0,0 @@
----
-title: "External Content Agreement"
-folder: "Legal"
-lastUpdated: "Sep. 10th 2024"
----
-
-# External Content Agreement (ECA)
-
-By making external content available for anyone to see, there needs to
-be an agreement to keep MHSF ("Minehut Server List") a friendly place
-for anyone to look at. _As such, this agreement outlines what you can't and can do, when making content on the platform._ The goal by making an agreement like this, is not to make you worried
-what you can upload, its just showing what the limits of content
-uploaded onto the platform are.
-
-## Source Code
-
-The source code for MHSF is defined by the [MIT License](Special:GitHub/blob/main/LICENSE). You are free to use MHSF for commercial use, and you may modify the software however you'd like. Taking copies of the software (aka _"forking"_) is also freely allowed.
-
-## What your limits are
-
-When creating content, if its a matter of making a profile picture,
-or editing the description for a server, (and more), you must follow
-the underlying agreements below.
-For making banners & descriptions, you must follow [Minehuts Terms of Service](Wiki:Rules) _as all content made is associated to Minehut (as the server is mostly on a community for Minehut)._
-For making Discord server embeds, you must follow [Discords Terms of Service](https://discord.com/terms/) _as all content made is associated to Discord._
-
-### All other content
-
-For all other content, they must follow the following:
-
-- No inappropriate/adult images
-- No swear words of any kind or slurs
-- Endorsing unethical client modifications (aka cheating or hacking)
-
-## When you agree to the ECA
-
-When you add customization to your server, or add a profile picture (linking an account is included), you must follow the ECA.
-
-## When linking an account
-
-When linking an account, you must follow the privacy policy and terms of service to the associated service that you linked your MHSF account to. Additionally, if you link an external account{" "}
-_after_ account creation, everything said before is still true.
-
-## Violations
-
-Violations from above have 1 warning. Your first interaction is a warning by removing the content from MHSF, and your 2nd is banning/deleting your account. (some violations are an instant delete)
-
-## Reporting
-
-If you personally see a violation of the ECA, you can report it by clicking the customization tab on a server, and hitting the Report
-button (it doesn't appear when the server was never owned). If you misuse this feature, you may get your account deleted.
diff --git a/docs/reading.mdx b/docs/reading.mdx
deleted file mode 100644
index 4505313..0000000
--- a/docs/reading.mdx
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: "Reading the docs"
----
-
-# Reading the docs
-The documentation in MHSF has some special symbols used in the docs that might be useful to know.
-
-
-
-## Icons
-When looking at a link, there will be symbols used that indicate where the link is going: *(these apply to the whole site)*
- - indicates the link will link to the [official Minehut wiki](Wiki:/)
- - indicates the link will link to another page on the docs
- - indicates the link will go to an external site
-
-When contributing, these links are as follows:
-```
-Wiki:
-Docs:
-Special:Root (links back to /)
-https://example.com
-
-**Example:**
-[Ranks](Wiki:Ranks)
-[Getting Started](Docs:Getting-started)
-https://google.com
-```
-
-The icons above will be automatically added when using the syntax above.
-The source code for above is stored [here](Special:GitHub/edit/main/src/components/misc/Link.tsx)
\ No newline at end of file
diff --git a/next-sitemap.config.js b/next-sitemap.config.js
deleted file mode 100644
index b35e009..0000000
--- a/next-sitemap.config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/** @type {import('next-sitemap').IConfig} */
-module.exports = {
- siteUrl: "https://mhsf.app",
- generateRobotsTxt: true
-}
\ No newline at end of file
diff --git a/next.config.mjs b/next.config.mjs
deleted file mode 100644
index fad225d..0000000
--- a/next.config.mjs
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { withContentlayer } from "next-contentlayer";
-
-/** @type {import('next').NextConfig} */
-const nextConfig = {
- images: {
- remotePatterns: [
- {
- protocol: "https",
- hostname: "img.clerk.com",
- },
- ],
- },
- async redirects() {
- return [
- {
- source: '/docs',
- destination: '/docs/getting-started',
- permanent: true,
- },
- ]
- },
-};
-
-export default withContentlayer(nextConfig);
diff --git a/package.json b/package.json
index 316dbdb..82abfd2 100644
--- a/package.json
+++ b/package.json
@@ -1,125 +1,23 @@
{
- "name": "mh-stats",
- "version": "1.3.0",
- "private": true,
- "packageManager": "yarn@1.22.22",
- "scripts": {
- "dev": "next dev",
- "build": "next build",
- "start": "next start",
- "lint": "next lint",
- "obfuscate": "next-css-obfuscator",
- "check-types": "tsc --noEmit",
- "inngest": "npx inngest-cli@latest dev",
- "postbuild": "next-sitemap"
- },
- "dependencies": {
- "@babel/parser": "^7.24.7",
- "@biomejs/biome": "^1.8.3",
- "@clerk/elements": "^0.22.2",
- "@clerk/nextjs": "^6.9.2",
- "@emotion/is-prop-valid": "^1.3.0",
- "@linear/sdk": "^31.0.0",
- "@monaco-editor/react": "^4.6.0",
- "@radix-ui/react-aspect-ratio": "^1.1.1",
- "@radix-ui/react-avatar": "^1.1.1",
- "@radix-ui/react-collapsible": "^1.1.1",
- "@radix-ui/react-hover-card": "^1.1.1",
- "@radix-ui/react-icons": "^1.3.0",
- "@radix-ui/react-menubar": "^1.1.1",
- "@radix-ui/react-primitive": "^2.0.0",
- "@radix-ui/react-select": "^2.1.2",
- "@radix-ui/react-switch": "^1.1.0",
- "@unocss/eslint-plugin": "^0.61.5",
- "@unocss/postcss": "^0.61.5",
- "@unocss/transformer-directives": "^0.61.5",
- "@unocss/webpack": "^0.61.5",
- "ag-grid-react": "^33.0.3",
- "contentlayer": "^0.3.4",
- "cron": "^3.1.7",
- "discord.js": "^14.15.3",
- "github-slugger": "^2.0.0",
- "inngest": "^3.21.2",
- "input-otp": "^1.2.4",
- "json-beautify": "^1.1.1",
- "lucide-react": "^0.454.0",
- "minimessage-2-html": "1.6.0",
- "minimessage-js": "^1.1.3",
- "mongodb": "^6.8.0",
- "next": "14.2.10",
- "next-contentlayer": "^0.3.4",
- "next-css-obfuscator": "^2.2.16",
- "next-sitemap": "^4.2.3",
- "next-themes": "^0.4.3",
- "nextjs-toploader": "^1.6.12",
- "nprogress": "^0.2.0",
- "postcss-obfuscator": "^1.6.1",
- "prettier": "^3.3.1",
- "react": "^18",
- "react-dom": "^18",
- "react-fade-in": "^2.0.1",
- "react-fast-marquee": "^1.6.5",
- "react-hot-toast": "^2.4.1",
- "react-qr-code": "^2.0.15",
- "react-snowfall": "^2.2.0",
- "rehype-slug": "^6.0.0",
- "remark-gfm": "^4.0.0",
- "sonner": "^1.7.0",
- "stripe-gradient": "^1.0.1",
- "tailwind-merge": "^2.3.0",
- "tailwindcss-animate": "^1.0.7",
- "tailwindcss-patch": "^4.0.0",
- "turbo": "^2.4.0",
- "unplugin-tailwindcss-mangle": "^3.0.1"
- },
- "devDependencies": {
- "@clerk/themes": "^2.1.19",
- "@hookform/resolvers": "^3.9.0",
- "@radix-ui/react-checkbox": "^1.1.1",
- "@radix-ui/react-context-menu": "^2.1.5",
- "@radix-ui/react-dialog": "^1.1.2",
- "@radix-ui/react-dropdown-menu": "^2.1.2",
- "@radix-ui/react-label": "^2.1.0",
- "@radix-ui/react-navigation-menu": "^1.1.4",
- "@radix-ui/react-popover": "^1.0.7",
- "@radix-ui/react-radio-group": "^1.2.0",
- "@radix-ui/react-scroll-area": "^1.1.0",
- "@radix-ui/react-separator": "^1.1.0",
- "@radix-ui/react-slot": "^1.1.0",
- "@radix-ui/react-tabs": "^1.1.0",
- "@radix-ui/react-tooltip": "^1.1.3",
- "@tailwindcss/typography": "^0.5.13",
- "@types/canvas-confetti": "^1.6.4",
- "@types/node": "^20",
- "@types/nprogress": "^0.2.3",
- "@types/react": "^18",
- "@types/react-dom": "^18",
- "@types/react-twemoji": "^0.4.3",
- "@unocss/eslint-config": "^0.61.5",
- "@unocss/preset-uno": "^0.61.5",
- "@unocss/transformer-compile-class": "^0.61.5",
- "@vercel/analytics": "^1.3.1",
- "@vercel/speed-insights": "^1.0.12",
- "canvas-confetti": "^1.9.3",
- "class-variance-authority": "^0.7.0",
- "clsx": "^2.1.1",
- "cmdk": "^1.0.0",
- "eslint": "^8",
- "eslint-config-next": "14.2.3",
- "framer-motion": "^11.3.8",
- "geist": "^1.3.0",
- "mangle-css-class-webpack-plugin": "^5.1.0",
- "postcss": "^8",
- "react-hook-form": "^7.52.2",
- "react-hotkeys-hook": "^4.5.0",
- "react-infinite-scroll-component": "^6.1.0",
- "react-markdown": "^9.0.1",
- "react-resizable-panels": "^2.0.23",
- "recharts": "^2.12.7",
- "shiki": "^1.23.0",
- "tailwindcss": "^3.4.1",
- "typescript": "^5",
- "vaul": "^0.9.1",
- "zod": "^3.23.8"
- }
+ "name": "MHSF-Modern",
+ "private": true,
+ "scripts": {
+ "build": "turbo build",
+ "dev": "turbo dev --filter=!cron",
+ "lint": "turbo lint",
+ "format": "prettier --write \"**/*.{ts,tsx,md}\""
+ },
+ "devDependencies": {
+ "prettier": "^3.5.0",
+ "turbo": "^2.4.2",
+ "typescript": "5.7.3"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "packageManager": "yarn@1.22.22",
+ "workspaces": [
+ "apps/*",
+ "packages/*"
+ ]
}
diff --git a/backend-mh-api/.gitignore b/packages/backend-mh-api/.gitignore
similarity index 100%
rename from backend-mh-api/.gitignore
rename to packages/backend-mh-api/.gitignore
diff --git a/backend-mh-api/README.md b/packages/backend-mh-api/README.md
similarity index 100%
rename from backend-mh-api/README.md
rename to packages/backend-mh-api/README.md
diff --git a/backend-mh-api/package.json b/packages/backend-mh-api/package.json
similarity index 100%
rename from backend-mh-api/package.json
rename to packages/backend-mh-api/package.json
diff --git a/src/lib/hooks/use-status.tsx b/packages/backend-mh-api/src/index.ts
similarity index 69%
rename from src/lib/hooks/use-status.tsx
rename to packages/backend-mh-api/src/index.ts
index f01c171..f1c1b90 100644
--- a/src/lib/hooks/use-status.tsx
+++ b/packages/backend-mh-api/src/index.ts
@@ -6,7 +6,7 @@
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
- * Copyright (c) 2024 dvelo
+ * Copyright (c) 2025 dvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -28,22 +28,30 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-import { useEffect, useState } from "react";
+import * as express from "express";
+import { config } from "dotenv";
-export default function useStatus() {
- const [loading, setLoading] = useState(true);
- const [incidents, setIncidents] = useState(null);
- const [statusURL, setStatusURL] = useState(null);
+config();
+const app = express();
- useEffect(() => {
- fetch("/api/v1/get-status")
- .then((c) => c.json())
- .then((d) => {
- setLoading(false);
- setIncidents(d.incidents);
- setStatusURL(d.url);
+app.get("/", (req, res) => {
+ res.send({ status: "up" });
+});
+
+app.get("/servers", (req, res) => {
+ if (
+ req.headers.Authentication !==
+ `MHSF-Backend-Server ${process.env.MHSF_SECRET}`
+ )
+ res.status(401).send({ error: "Unauthorized" });
+ else
+ fetch("https://api.minehut.com/servers").then((c) => {
+ c.json().then((v) => {
+ res.send(v);
});
- }, []);
+ });
+});
- return { loading, incidents, statusURL };
-}
+app.listen(6080, () => {
+ console.log("Backend API listening on port 6080");
+});
diff --git a/backend-mh-api/tsconfig.json b/packages/backend-mh-api/tsconfig.json
similarity index 100%
rename from backend-mh-api/tsconfig.json
rename to packages/backend-mh-api/tsconfig.json
diff --git a/backend-mh-api/yarn.lock b/packages/backend-mh-api/yarn.lock
similarity index 100%
rename from backend-mh-api/yarn.lock
rename to packages/backend-mh-api/yarn.lock
diff --git a/cron/.gitignore b/packages/cron/.gitignore
similarity index 100%
rename from cron/.gitignore
rename to packages/cron/.gitignore
diff --git a/cron/Dockerfile b/packages/cron/Dockerfile
similarity index 100%
rename from cron/Dockerfile
rename to packages/cron/Dockerfile
diff --git a/cron/README.md b/packages/cron/README.md
similarity index 100%
rename from cron/README.md
rename to packages/cron/README.md
diff --git a/cron/config.yaml b/packages/cron/config.yaml
similarity index 100%
rename from cron/config.yaml
rename to packages/cron/config.yaml
diff --git a/cron/package.json b/packages/cron/package.json
similarity index 90%
rename from cron/package.json
rename to packages/cron/package.json
index 4fc32d6..62f71e9 100644
--- a/cron/package.json
+++ b/packages/cron/package.json
@@ -4,7 +4,7 @@
"description": "In version 1.0, MHSF moved from using Inngest to collect statistics to a self-hosted `crontab` Node.js script.",
"main": "dist/index.js",
"scripts": {
- "dev": "npx tsx src/index.ts",
+ "dev": "MHC_DOCKER=true npx tsx src/index.ts",
"build": "npx tsc -p ./tsconfig.json"
},
"author": "",
diff --git a/cron/src/index.ts b/packages/cron/src/index.ts
similarity index 98%
rename from cron/src/index.ts
rename to packages/cron/src/index.ts
index 102f628..41cad9f 100644
--- a/cron/src/index.ts
+++ b/packages/cron/src/index.ts
@@ -1,12 +1,12 @@
/*
* MHSF, Minehut Server List
* All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
+ * located here: https://mhsf.app/docs/legal/external-content-agreement
*
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
- * Copyright (c) 2024 dvelo
+ * Copyright (c) 2025 dvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
diff --git a/cron/src/types/achievement.ts b/packages/cron/src/types/achievement.ts
similarity index 93%
rename from cron/src/types/achievement.ts
rename to packages/cron/src/types/achievement.ts
index d13e511..c5db78e 100644
--- a/cron/src/types/achievement.ts
+++ b/packages/cron/src/types/achievement.ts
@@ -1,12 +1,12 @@
/*
* MHSF, Minehut Server List
* All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
+ * located here: https://mhsf.app/docs/legal/external-content-agreement
*
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
- * Copyright (c) 2024 dvelo
+ * Copyright (c) 2025 dvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
diff --git a/cron/src/types/mh-server.ts b/packages/cron/src/types/mh-server.ts
similarity index 96%
rename from cron/src/types/mh-server.ts
rename to packages/cron/src/types/mh-server.ts
index 7048d56..18ebd72 100644
--- a/cron/src/types/mh-server.ts
+++ b/packages/cron/src/types/mh-server.ts
@@ -1,12 +1,12 @@
/*
* MHSF, Minehut Server List
* All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
+ * located here: https://mhsf.app/docs/legal/external-content-agreement
*
* All code under MHSF is licensed under the MIT License
* by open source contributors
*
- * Copyright (c) 2024 dvelo
+ * Copyright (c) 2025 dvelo
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
diff --git a/cron/tsconfig.json b/packages/cron/tsconfig.json
similarity index 100%
rename from cron/tsconfig.json
rename to packages/cron/tsconfig.json
diff --git a/cron/yarn.lock b/packages/cron/yarn.lock
similarity index 100%
rename from cron/yarn.lock
rename to packages/cron/yarn.lock
diff --git a/postcss.config.mjs b/postcss.config.mjs
deleted file mode 100644
index b713959..0000000
--- a/postcss.config.mjs
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/** @type {import('postcss-load-config').Config} */
-const config = {
- plugins: {
- tailwindcss: {},
- },
-};
-
-export default config;
diff --git a/public/branding/dark-banner.png b/public/branding/dark-banner.png
deleted file mode 100644
index ccecbf6..0000000
Binary files a/public/branding/dark-banner.png and /dev/null differ
diff --git a/public/branding/full-desktop-light.png b/public/branding/full-desktop-light.png
deleted file mode 100644
index e6f1ffb..0000000
Binary files a/public/branding/full-desktop-light.png and /dev/null differ
diff --git a/public/branding/full-desktop.png b/public/branding/full-desktop.png
deleted file mode 100644
index 071c21b..0000000
Binary files a/public/branding/full-desktop.png and /dev/null differ
diff --git a/public/branding/light-banner.png b/public/branding/light-banner.png
deleted file mode 100644
index 9d09f93..0000000
Binary files a/public/branding/light-banner.png and /dev/null differ
diff --git a/public/branding/meta-banner.png b/public/branding/meta-banner.png
deleted file mode 100644
index fab38f5..0000000
Binary files a/public/branding/meta-banner.png and /dev/null differ
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index 9a1e9d5..0000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/public/imgs/badge1.gif b/public/imgs/badge1.gif
deleted file mode 100644
index aea3d57..0000000
Binary files a/public/imgs/badge1.gif and /dev/null differ
diff --git a/public/imgs/icon-cf.png b/public/imgs/icon-cf.png
deleted file mode 100644
index 09cfcb4..0000000
Binary files a/public/imgs/icon-cf.png and /dev/null differ
diff --git a/public/imgs/icon-gd.png b/public/imgs/icon-gd.png
deleted file mode 100644
index 45a71b9..0000000
Binary files a/public/imgs/icon-gd.png and /dev/null differ
diff --git a/public/imgs/icon-gl.png b/public/imgs/icon-gl.png
deleted file mode 100644
index 20914ae..0000000
Binary files a/public/imgs/icon-gl.png and /dev/null differ
diff --git a/public/imgs/icon-p.png b/public/imgs/icon-p.png
deleted file mode 100644
index 9988606..0000000
Binary files a/public/imgs/icon-p.png and /dev/null differ
diff --git a/public/imgs/icon-scf.png b/public/imgs/icon-scf.png
deleted file mode 100644
index b7700ac..0000000
Binary files a/public/imgs/icon-scf.png and /dev/null differ
diff --git a/public/imgs/icon-sgd.png b/public/imgs/icon-sgd.png
deleted file mode 100644
index 5aa66ca..0000000
Binary files a/public/imgs/icon-sgd.png and /dev/null differ
diff --git a/public/imgs/icon-sgl.png b/public/imgs/icon-sgl.png
deleted file mode 100644
index a10f459..0000000
Binary files a/public/imgs/icon-sgl.png and /dev/null differ
diff --git a/public/imgs/icon-sp.png b/public/imgs/icon-sp.png
deleted file mode 100644
index d43243a..0000000
Binary files a/public/imgs/icon-sp.png and /dev/null differ
diff --git a/public/itemsCSS/icons.png b/public/itemsCSS/icons.png
deleted file mode 100644
index 384b3ce..0000000
Binary files a/public/itemsCSS/icons.png and /dev/null differ
diff --git a/public/robots.txt b/public/robots.txt
deleted file mode 100644
index 1c6d398..0000000
--- a/public/robots.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# *
-User-agent: *
-Allow: /
-
-# Host
-Host: https://mhsf.app
-
-# Sitemaps
-Sitemap: https://mhsf.app/sitemap.xml
diff --git a/public/sitemap.xml b/public/sitemap.xml
deleted file mode 100644
index 39fed00..0000000
--- a/public/sitemap.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/public/svg/icon-cf.svg b/public/svg/icon-cf.svg
deleted file mode 100644
index f3aa775..0000000
--- a/public/svg/icon-cf.svg
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
diff --git a/public/svg/icon-gd.svg b/public/svg/icon-gd.svg
deleted file mode 100644
index fde9310..0000000
--- a/public/svg/icon-gd.svg
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
diff --git a/public/svg/icon-gl.svg b/public/svg/icon-gl.svg
deleted file mode 100644
index 6ca9108..0000000
--- a/public/svg/icon-gl.svg
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
diff --git a/public/svg/icon-p.svg b/public/svg/icon-p.svg
deleted file mode 100644
index c0e241f..0000000
--- a/public/svg/icon-p.svg
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
diff --git a/public/svg/icon-scf.svg b/public/svg/icon-scf.svg
deleted file mode 100644
index 203902b..0000000
--- a/public/svg/icon-scf.svg
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
diff --git a/public/svg/icon-sgd.svg b/public/svg/icon-sgd.svg
deleted file mode 100644
index 5cbcd07..0000000
--- a/public/svg/icon-sgd.svg
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
diff --git a/public/svg/icon-sgl.svg b/public/svg/icon-sgl.svg
deleted file mode 100644
index 1b6d886..0000000
--- a/public/svg/icon-sgl.svg
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
diff --git a/public/svg/icon-sp.svg b/public/svg/icon-sp.svg
deleted file mode 100644
index 2b275ad..0000000
--- a/public/svg/icon-sp.svg
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
diff --git a/public/videos/imgurTutorial.mp4 b/public/videos/imgurTutorial.mp4
deleted file mode 100644
index eea10d1..0000000
Binary files a/public/videos/imgurTutorial.mp4 and /dev/null differ
diff --git a/src/app/(docs)/docs/[[...slug]]/page.tsx b/src/app/(docs)/docs/[[...slug]]/page.tsx
deleted file mode 100644
index 1b563f2..0000000
--- a/src/app/(docs)/docs/[[...slug]]/page.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import TableOfContent from "@/components/docs/TOC";
-import { ALegacy } from "@/components/misc/Link";
-import { MDXElements } from "@/components/misc/MDXElements";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import { Separator } from "@/components/ui/separator";
-import { allDocs } from "contentlayer/generated";
-import { useMDXComponent } from "next-contentlayer/hooks";
-import NextLink from "next/link";
-import { notFound } from "next/navigation";
-
-export const generateStaticParams = async () =>
- allDocs.map((post) => ({ slug: [post._raw.flattenedPath] }));
-
-export const generateMetadata = ({
- params,
-}: {
- params: { slug: string[] };
-}) => {
- const post = allDocs.find(
- (post) => post._raw.flattenedPath === params.slug.join("/"),
- );
- if (!post) notFound();
- return { title: post.title + " | MHSF Docs", themeColor: "#000000" };
-};
-
-const PostLayout = ({ params }: { params: { slug: string[] } }) => {
- const doc = allDocs.find(
- (post) => post._raw.flattenedPath === params.slug.join("/"),
- );
-
- if (!doc) notFound();
- console.log(doc);
- const MDXContent = useMDXComponent(doc.body.code);
-
- return (
-
-
- )}
-
- );
-};
-export default PostLayout;
diff --git a/src/app/(docs)/layout.tsx b/src/app/(docs)/layout.tsx
deleted file mode 100644
index 3577caf..0000000
--- a/src/app/(docs)/layout.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-
-import { Sidebar } from "@/components/docs/Sidebar";
-import { Button } from "@/components/ui/button";
-import { Drawer, DrawerContent, DrawerTrigger } from "@/components/ui/drawer";
-import { ScrollArea } from "@/components/ui/scroll-area";
-import {
- SidebarInset,
- SidebarProvider,
- SidebarTrigger,
-} from "@/components/ui/sidebar";
-import { version } from "@/config/version";
-import { HamburgerMenuIcon } from "@radix-ui/react-icons";
-import { GeistMono } from "geist/font/mono";
-import { GeistSans } from "geist/font/sans";
-import "../globals.css";
-import "../../themes.css";
-import { ThemeProvider } from "@/components/ThemeProvider";
-import { ClerkThemeProvider } from "@/components/clerk/ClerkThemeProvider";
-import {
- Breadcrumb,
- BreadcrumbItem,
- BreadcrumbLink,
- BreadcrumbList,
- BreadcrumbPage,
- BreadcrumbSeparator,
-} from "@/components/ui/breadcrumb";
-import { Separator } from "@/components/ui/separator";
-import NextTopLoader from "@/lib/top-loader";
-import { useRouter } from "@/lib/useRouter";
-import { allDocs } from "contentlayer/generated";
-import { GetServerSideProps } from "next";
-import { usePathname } from "next/navigation";
-
-interface Props {
- pathname: string;
-}
-
-export default async function RootLayout({
- children,
-}: Readonly<{
- children: React.ReactNode;
-}>) {
- const pathname = usePathname();
- return (
-
-
-
- );
-}
diff --git a/src/app/(embeds)/embed/[server]/page.tsx b/src/app/(embeds)/embed/[server]/page.tsx
deleted file mode 100644
index b2a739e..0000000
--- a/src/app/(embeds)/embed/[server]/page.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import Embed from "@/components/feat/Embed";
-
-export default function EmbedPage({
- params,
-}: {
- params: { server: string };
-}) {
- return ;
-}
diff --git a/src/app/(embeds)/layout.tsx b/src/app/(embeds)/layout.tsx
deleted file mode 100644
index 7469149..0000000
--- a/src/app/(embeds)/layout.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { TooltipProvider } from "@/components/ui/tooltip";
-import "../globals.css";
-import { ThemeProvider } from "@/components/ThemeProvider";
-import { useSearchParams } from "next/navigation";
-
-export default function RootLayout({
- children,
-}: {
- children: React.ReactNode;
-}) {
- const searchParams = useSearchParams();
- const search = searchParams?.get("theme") || "light";
- return (
-
-
-
- {children}
-
-
-
- );
-}
diff --git a/src/app/(main)/account/favorites/page.tsx b/src/app/(main)/account/favorites/page.tsx
deleted file mode 100644
index c69c599..0000000
--- a/src/app/(main)/account/favorites/page.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import FavoritesView from "@/components/FavoritesView";
-
-export default function Favorites() {
- return (
-
-
-
-
-
- );
-}
diff --git a/src/app/(main)/account/settings/layout.tsx b/src/app/(main)/account/settings/layout.tsx
deleted file mode 100644
index b1e73bf..0000000
--- a/src/app/(main)/account/settings/layout.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { Sidebar } from "@/components/PreferencesSidebar";
-import { usePathname } from "next/navigation";
-
-export default function RootLayout({
- children,
-}: Readonly<{
- children: React.ReactNode;
-}>) {
- const pathname = usePathname();
-
- return (
-
- {children}
-
- );
-}
diff --git a/src/app/(main)/account/settings/options/page.tsx b/src/app/(main)/account/settings/options/page.tsx
deleted file mode 100644
index 89c1b4e..0000000
--- a/src/app/(main)/account/settings/options/page.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { useClerk, useUser } from "@clerk/nextjs";
-import { useEffect, useState } from "react";
-import { SLCustomize } from "@/components/SLCustomizePage";
-
-export default function Settings() {
- const clerk = useClerk();
-
- const { user, isSignedIn } = useUser();
- const [linked, setLinked] = useState(false);
- useEffect(() => {
- setLinked(user?.publicMetadata.player != undefined);
- }, [user, isSignedIn]);
-
- return (
-
- Profile Preferences
-
-
-
-
- );
-}
diff --git a/src/app/(main)/account/settings/page.tsx b/src/app/(main)/account/settings/page.tsx
deleted file mode 100644
index 9d253d2..0000000
--- a/src/app/(main)/account/settings/page.tsx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { Button } from "@/components/ui/button";
-import { useClerk, useUser } from "@clerk/nextjs";
-import { toast } from "sonner";
-import { unlinkMCAccount } from "@/lib/api";
-import { useEffect, useState } from "react";
-import { Dialog } from "@/components/ui/dialog";
-import { DialogContent, DialogTrigger } from "@/components/ui/dialog";
-import CodeDialog from "@/components/misc/LinkDialog";
-
-export default function Settings() {
- const clerk = useClerk();
-
- const { user, isSignedIn } = useUser();
- const [linked, setLinked] = useState(false);
- useEffect(() => {
- setLinked(user?.publicMetadata.player != undefined);
- }, [user, isSignedIn]);
-
- const forceUnlink = async () => {
- if (!linked) await toast.promise(unlinkMCAccount(), {
- success: "Unlinked account!",
- loading: "Unlinking...",
- error: "Error while unlinking account.",
- });
- else
- await toast.warning("Please use the normal unlink option before using the force unlink one.")
- };
-
- return (
-
- Linking
-
-
- Link Account
-
-
- Link a Minecraft account to customize a server you own.
- {" "}
- {user?.publicMetadata.player != undefined && linked && (
- <>Currently linked to {user?.publicMetadata.player as string}>
- )}
-
-
-
-
- {linked && (
-
- )}
-
-
- Unlink Account
-
-
Unlink your Minecraft account if you have already linked one.
-
-
- );
-}
diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx
deleted file mode 100644
index 9cfe6a2..0000000
--- a/src/app/(main)/layout.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { Analytics } from "@vercel/analytics/react";
-import { SpeedInsights } from "@vercel/speed-insights/next";
-import { GeistSans } from "geist/font/sans";
-import "../globals.css";
-import { CommandBarer } from "@/components/CommandBar";
-import { ThemeProvider } from "@/components/ThemeProvider";
-import { ClerkThemeProvider } from "@/components/clerk/ClerkThemeProvider";
-import NewDomainDialog from "@/components/misc/NewDomainDialog";
-import ThemedToaster from "@/components/misc/ThemedToaster";
-import { TooltipProvider } from "@/components/ui/tooltip";
-import type { Metadata, Viewport } from "next";
-import { Inter as interFont } from "next/font/google";
-import LayoutPart from "@/components/feat/LayoutPart";
-import AllBanners from "@/components/feat/AllBanners";
-import Footer from "@/components/misc/Footer";
-import { SwitchEnvPopup } from "@/components/misc/SwitchEnvPopup";
-
-export const extraMetadata = {
- twitter: {
- images: [
- {
- url: "/imgs/icon-cf.png",
- },
- ],
- },
- themeColor: "#000000",
- openGraph: {
- images: [
- {
- url: "/imgs/icon-cf.png",
- },
- ],
- },
-} satisfies Metadata;
-export const viewport: Viewport = {
- themeColor: "black",
- colorScheme: "dark",
-};
-
-const inter = interFont({ variable: "--font-inter", subsets: ["latin"] });
-export default async function RootLayout({
- children,
-}: Readonly<{
- children: React.ReactNode;
-}>) {
- return (
-
-
-
-
- {children}
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/app/(main)/not-found.tsx b/src/app/(main)/not-found.tsx
deleted file mode 100644
index f241c5e..0000000
--- a/src/app/(main)/not-found.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import Link from "next/link";
-
-export default function NotFound() {
- return (
-
-
- 404 - Page not found
-
-
- We couldn't find the page you were looking for.{" "}
- Go home
-
-
-
- );
-}
diff --git a/src/app/(main)/page.tsx b/src/app/(main)/page.tsx
deleted file mode 100644
index 2a468ee..0000000
--- a/src/app/(main)/page.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import ServerList from "@/components/ServerList";
-import { Metadata } from "next";
-
-export const metadata: Metadata = {
- title: "the MHSF project by dvelo",
- description:
- process.env.NEXT_PUBLIC_VERCEL_ENV != undefined
- ? `currently running in ${process.env.NEXT_PUBLIC_VERCEL_ENV} | commit (${(process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA as string).substring(0, 7)}}) "${process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_MESSAGE}" by ${process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_AUTHOR_NAME}`
- : "currently running in dev",
- twitter: {
- images: [
- {
- url: "/imgs/icon-cf.png",
- },
- ],
- },
- themeColor: "#000000",
- openGraph: {
- images: [
- {
- url: "/imgs/icon-cf.png",
- },
- ],
- },
-};
-
-export default function Home() {
- return (
-
-
-
-
-
- );
-}
diff --git a/src/app/(main)/server/[server]/customize/page.tsx b/src/app/(main)/server/[server]/customize/page.tsx
deleted file mode 100644
index 4b91309..0000000
--- a/src/app/(main)/server/[server]/customize/page.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import type { Metadata, ResolvingMetadata } from "next";
-import CustomizeRoot from "@/components/CustomizeRoot";
-
-type Props = {
- params: { server: string };
-};
-
-export async function generateMetadata(
- { params }: Props,
- parent: ResolvingMetadata
-): Promise {
- // read route params
- const { server } = params;
- const json = await (
- await fetch("https://api.minehut.com/server/" + server + "?byName=true")
- ).json();
-
- return {
- title:
- json.server == null
- ? "Server doesn't exist | MHSF"
- : json.server.name +
- ", " +
- (json.server.online
- ? json.server.playerCount +
- (json.server.maxPlayers != 10
- ? "/" + json.server.maxPlayers
- : "") +
- " online"
- : "Offline") +
- " | MHSF",
- description:
- json.server == null
- ? `The server ${server} doesn't exist.`
- : `View ${server} on Minehut Server Finder!`,
- authors: json.server == null ? undefined : { name: json.server.owner },
- applicationName: "MHSF (Minehut Server Finder)",
- icons:
- json.server == null
- ? undefined
- : "https://mcapi.marveldc.me/item/" +
- (json.server.icon == undefined ? "OAK_SIGN" : json.server.icon) +
- "?width=64&height=64",
- openGraph: {
- type: "profile",
- siteName: "MHSF (Minehut Server Finder)",
- images: [
- {
- url:
- "https://mcapi.marveldc.me/item/" +
- json.server.icon +
- "?width=64&height=64",
- },
- {
- url: "/favicon.ico",
- },
- ],
- },
- };
-}
-
-export default function ServerPage({ params }: { params: { server: string } }) {
- return (
-
-
-
- );
-}
diff --git a/src/app/(main)/server/[server]/layout.tsx b/src/app/(main)/server/[server]/layout.tsx
deleted file mode 100644
index eabbd18..0000000
--- a/src/app/(main)/server/[server]/layout.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-
-import { LoadingSpinner } from "@/components/ui/loading-spinner";
-import { useServerExists } from "@/lib/hooks/use-server-exists";
-import { notFound } from "next/navigation";
-
-export default function ServerLayout({
- params,
- children,
-}: {
- params: { server: string };
- children: React.ReactNode;
-}) {
- const { serverExists, loading } = useServerExists(params.server);
-
- if (loading) return ;
-
- if (!serverExists) notFound();
-
- return children;
-}
diff --git a/src/app/(main)/server/[server]/page.tsx b/src/app/(main)/server/[server]/page.tsx
deleted file mode 100644
index f5d9f9d..0000000
--- a/src/app/(main)/server/[server]/page.tsx
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import AfterServerView from "@/components/AfterServerView";
-import Banner from "@/components/Banner";
-import ColorProvider from "@/components/ColorProvider";
-import ServerView from "@/components/ServerView";
-import StickyTopbar from "@/components/misc/StickyTopbar";
-import TabServer from "@/components/misc/TabServer";
-import type { Metadata, ResolvingMetadata } from "next";
-
-type Props = {
- params: { server: string };
-};
-
-export async function generateMetadata(
- { params }: Props,
- parent: ResolvingMetadata
-): Promise {
- // read route params
- const { server } = params;
- const json = await (
- await fetch("https://api.minehut.com/server/" + server + "?byName=true")
- ).json();
-
- return {
- themeColor: "#000000",
- title:
- json.server == null
- ? "Server doesn't exist | MHSF"
- : json.server.name +
- ", " +
- (json.server.online
- ? json.server.playerCount +
- (json.server.maxPlayers != 10
- ? "/" + json.server.maxPlayers
- : "") +
- " online"
- : "Offline") +
- " | MHSF",
- description:
- json.server == null
- ? `The server ${server} doesn't exist.`
- : `View ${server} on Minehut Server Finder!`,
- authors: json.server == null ? undefined : { name: json.server.owner },
- applicationName: "MHSF (Minehut Server Finder)",
- icons:
- json.server == null
- ? undefined
- : "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
- (json.server.icon == undefined ? "OAK_SIGN" : json.server.icon) +
- ".png",
- twitter: {
- title:
- json.server == null
- ? "Server doesn't exist | MHSF"
- : json.server.name +
- ", " +
- (json.server.online
- ? json.server.playerCount +
- (json.server.maxPlayers != 10
- ? "/" + json.server.maxPlayers
- : "") +
- " online"
- : "Offline") +
- " | MHSF",
- description:
- json.server == null
- ? `The server ${server} doesn't exist.`
- : `View ${server} on Minehut Server Finder!`,
- images: [
- {
- url:
- "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
- json.server.icon +
- ".png",
- },
- {
- url: "/public/imgs/icon-cf.png",
- },
- ],
- },
- openGraph: {
- type: "profile",
- siteName: "MHSF (Minehut Server Finder)",
-
- images: [
- {
- url:
- "https://minehut-server-icons-live.s3.us-west-2.amazonaws.com/" +
- json.server.icon +
- ".png",
- },
- {
- url: "/public/imgs/icon-cf.png",
- },
- ],
- },
- };
-}
-
-export default function ServerPage({ params }: { params: { server: string } }) {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/app/(main)/server/[server]/statistics/page.tsx b/src/app/(main)/server/[server]/statistics/page.tsx
deleted file mode 100644
index c1a7afa..0000000
--- a/src/app/(main)/server/[server]/statistics/page.tsx
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import Banner from "@/components/Banner";
-import ColorProvider from "@/components/ColorProvider";
-import { NewChart } from "@/components/charts/NewChart";
-import ServerView from "@/components/ServerView";
-import TabServer from "@/components/misc/TabServer";
-import type { Metadata, ResolvingMetadata } from "next";
-import StickyTopbar from "@/components/misc/StickyTopbar";
-import { RelativeChart } from "@/components/charts/RelativeChart";
-import { MonthlyChart } from "@/components/charts/MonthlyChart";
-import { DailyChart } from "@/components/charts/DailyChart";
-
-type Props = {
- params: { server: string };
-};
-
-export async function generateMetadata(
- { params }: Props,
- parent: ResolvingMetadata
-): Promise {
- // read route params
- const { server } = params;
- const json = await (
- await fetch("https://api.minehut.com/server/" + server + "?byName=true")
- ).json();
-
- return {
- title:
- json.server == null
- ? "Server doesn't exist | MHSF"
- : json.server.name +
- ", " +
- (json.server.online
- ? json.server.playerCount +
- (json.server.maxPlayers != 10
- ? "/" + json.server.maxPlayers
- : "") +
- " online"
- : "Offline") +
- " | MHSF",
- description:
- json.server == null
- ? `The server ${server} doesn't exist.`
- : `View ${server} on Minehut Server Finder!`,
- authors: json.server == null ? undefined : { name: json.server.owner },
- applicationName: "MHSF (Minehut Server Finder)",
- icons:
- json.server == null
- ? undefined
- : "https://mcapi.marveldc.me/item/" +
- (json.server.icon == undefined ? "OAK_SIGN" : json.server.icon) +
- "?width=64&height=64",
- openGraph: {
- type: "profile",
- siteName: "MHSF (Minehut Server Finder)",
- images: [
- {
- url:
- "https://mcapi.marveldc.me/item/" +
- json.server.icon +
- "?width=64&height=64",
- },
- {
- url: "/favicon.ico",
- },
- ],
- },
- };
-}
-
-export default function ServerPage({ params }: { params: { server: string } }) {
- return (
-
-
-
-
-
- Plan Details
-
- Information about the plan being used by the server
-
-
- {(() => {
- console.log(serverObject);
- return true;
- })()}
-
- {" "}
-
-
-
Server plan
-
- {serverObject?.expired == undefined ? (
-
- Free{" "}
-
-
-
-
-
-
-
- The plan is really unknown, but in most
- scenarios, the Minehut API returns{" "}
- undefined if the server is free.
-
-
-
;
-}
diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx
deleted file mode 100644
index d5aad92..0000000
--- a/src/components/Banner.tsx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { getCustomization } from "@/lib/api";
-import { useEffect, useState } from "react";
-import useTotalBannerSize from "@/lib/hooks/use-total-banner-size";
-
-export default function Banner({ server }: { server: string }) {
- const [bannerURL, setBannerURL] = useState("");
- const [loading, setLoading] = useState(true);
- const { bannerSize } = useTotalBannerSize();
-
- useEffect(() => {
- getCustomization(server).then((c) => {
- if (c != null) {
- setLoading(false);
- setBannerURL(c.banner == undefined ? "" : c.banner);
- } else {
- setLoading(false);
- }
- });
- }, [server]);
-
- if (loading) {
- return (
- <>
-
- >
- );
- }
-
- return (
- <>
- {bannerURL != "" && (
-
- )}
-
- >
- );
-}
diff --git a/src/components/Changelog.tsx b/src/components/Changelog.tsx
deleted file mode 100644
index be3c465..0000000
--- a/src/components/Changelog.tsx
+++ /dev/null
@@ -1,267 +0,0 @@
-"use client";
-
-import {
- ArrowUpToLine,
- Bell,
- BookIcon,
- Check,
- Globe,
- Home,
- Keyboard,
- Link,
- Lock,
- Menu,
- MessageCircle,
- Paintbrush,
- Settings,
- Video,
-} from "lucide-react";
-import * as React from "react";
-
-import Marquee from "@/components/effects/marquee";
-import {
- Breadcrumb,
- BreadcrumbItem,
- BreadcrumbLink,
- BreadcrumbList,
- BreadcrumbPage,
- BreadcrumbSeparator,
-} from "@/components/ui/breadcrumb";
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogTitle,
- DialogTrigger,
-} from "@/components/ui/dialog";
-import { Separator } from "@/components/ui/separator";
-import {
- Sidebar,
- SidebarContent,
- SidebarGroup,
- SidebarGroupContent,
- SidebarMenu,
- SidebarMenuButton,
- SidebarMenuItem,
- SidebarProvider,
- SidebarSeparator,
-} from "@/components/ui/sidebar";
-import { useDepTheme } from "@/lib/getDependentTheming";
-import { BorderTopIcon } from "@radix-ui/react-icons";
-import { ReactNode, useState } from "react";
-import type { SVGProps } from "react";
-
-export function Changelog({
- items,
- children,
-}: {
- items: { name: string; id: string; changelog: ReactNode }[];
- children: ReactNode;
-}) {
- const [inTab, setInTab] = useState(false);
- const [tab, setTab] = useState("");
- const iconTheme = useDepTheme();
-
- return (
-
- );
-}
-
-const Github = (props: SVGProps) => (
-
-);
-
-const Discord = (props: SVGProps) => (
-
-);
diff --git a/src/components/ClientFadeIn.tsx b/src/components/ClientFadeIn.tsx
deleted file mode 100644
index 70fe411..0000000
--- a/src/components/ClientFadeIn.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import FadeIn from "react-fade-in";
-
-export default function ClientFadeIn({
- children,
- delay = 0,
- id,
-}: {
- children: React.ReactNode;
- delay?: number;
- id?: string;
-}) {
- return (
-
- {children}
-
- );
-}
diff --git a/src/components/ColorProvider.tsx b/src/components/ColorProvider.tsx
deleted file mode 100644
index ce0455f..0000000
--- a/src/components/ColorProvider.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { getCustomization } from "@/lib/api";
-import { useEffect, useState } from "react";
-import "@/themes.css";
-import { toast } from "sonner";
-import { useRouter } from "@/lib/useRouter";
-import { useEffectOnce } from "@/lib/useEffectOnce";
-
-export default function ColorProvider({
- server,
- children,
- fetchV,
-}: {
- server: string;
- children: any;
- fetchV?: any;
-}) {
- const [color, setColor] = useState("zinc");
- const nav = useRouter();
-
- useEffectOnce(() => {
- fetch("https://api.minehut.com/server/" + server + "?byName=true")
- .then((c) => c.json())
- .then((c: any) => {
- console.log(c.server.name, server);
- if (c.server.name !== server) {
- toast.warning(
- "The capitalization of this server was incorrect. If your using a permanent link resource, please change it to account for a new name. (" +
- c.server.name +
- ") Redirecting now.",
- { duration: 15000 }
- );
- nav.replace("/server/" + c.server.name);
- }
- });
- });
-
- useEffect(() => {
- if (!fetchV)
- getCustomization(server).then((v) =>
- setColor(v != null ? v.colorScheme : "zinc")
- );
- else setColor(fetchV.colorScheme);
- }, []);
-
- return
{children}
;
-}
diff --git a/src/components/CommandBar.tsx b/src/components/CommandBar.tsx
deleted file mode 100644
index 51c6e20..0000000
--- a/src/components/CommandBar.tsx
+++ /dev/null
@@ -1,860 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import {
- CommandDialog,
- CommandEmpty,
- CommandGroup,
- CommandInput,
- CommandItem,
- CommandList,
- CommandSeparator,
- CommandShortcut,
-} from "@/components/ui/command";
-import { useEffect, useState } from "react";
-import events from "@/lib/commandEvent";
-import { useHotkeys } from "react-hotkeys-hook";
-import {
- ArrowDown01,
- ArrowLeft,
- Calendar,
- CheckIcon,
- CommandIcon,
- Database,
- LinkIcon,
- Server,
- ServerCog,
- Settings,
- Star,
- XIcon,
-} from "lucide-react";
-import { useEffectOnce } from "@/lib/useEffectOnce";
-import { useClerk, useUser } from "@clerk/nextjs";
-import { useRouter } from "@/lib/useRouter";
-import type { SVGProps } from "react";
-import {
- favoriteServer,
- getAccountFavorites,
- isFavorited,
- serverOwned,
-} from "@/lib/api";
-import IconDisplay from "./IconDisplay";
-import ServerSingle from "@/lib/single";
-import { toast } from "sonner";
-import { ServerResponse, OnlineServer } from "@/lib/types/mh-server";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogHeader,
- DialogTitle,
-} from "./ui/dialog";
-import { TagShower } from "./ServerList";
-import { Button } from "./ui/button";
-import { useTheme } from "next-themes";
-import { CheckmarkIcon } from "react-hot-toast";
-
-export function SearchCommandBar() {
- const [serverList, setServerList] = useState([]);
- const [open, setOpen] = useState(false);
- const [backEnabled, setBackEnabled] = useState(false);
- const [searchRes, setSearchRes] = useState(
- undefined
- );
- const router = useRouter();
- useHotkeys("mod+shift+k", () => setOpen(true), []);
-
- useEffectOnce(() => {
- events.on("search-request-event", () => {
- setOpen(true);
- setSearchRes(undefined);
- });
- events.on("search-request-event-back", () => {
- setOpen(true);
- setBackEnabled(true);
- setSearchRes(undefined);
- });
-
- fetch("https://api.minehut.com/servers").then((c) =>
- c.json().then((b: { servers: OnlineServer[] }) => {
- setServerList(b.servers.slice(0, 20));
- })
- );
- });
-
- return (
-
- {
- if (c != "") {
- fetch("https://api.minehut.com/server/" + c + "?byName=true").then(
- (l) => {
- l.json().then((m: any) => {
- if (m.server != null) {
- console.log(m);
- setSearchRes(m.server);
- } else {
- setSearchRes(undefined);
- }
- });
- }
- );
- }
- }}
- />
-
- {searchRes != undefined && (
-
- {
- if (!backEnabled) events.emit("cmd-offline", searchRes);
- if (backEnabled) events.emit("cmd-offline-vb", searchRes);
- setOpen(false);
- }}
- >
- {searchRes?.name}
-
-
- )}
-
- {searchRes == undefined && (
-
- {serverList.map((b: OnlineServer) => (
- {
- if (!backEnabled)
- events.emit("cmd-server", {
- serverName: b.name,
- serverObject: b,
- });
- if (backEnabled)
- events.emit("cmd-server-vb", {
- serverName: b.name,
- serverObject: b,
- });
- setOpen(false);
- }}
- >
-
- {b.name}
-
- ))}
-
- )}
-
-
- {
- setOpen(false);
- if (backEnabled) events.emit("cmd-event");
- setBackEnabled(false);
- }}
- >
-
- Go back
-
-
-
-
- );
-}
-
-export function OfflineServerCB() {
- const [open, setOpen] = useState(false);
- const [customized, setCustomized] = useState(false);
- const [obj, setObj] = useState({});
- const [vb, setVB] = useState(false);
- const { isSignedIn } = useUser();
- const router = useRouter();
- const [starred, setStarred] = useState(false);
- const { resolvedTheme } = useTheme();
-
- useEffect(() => {
- events.on("cmd-offline", (info: ServerResponse) => {
- if (info.online) {
- fetch("https://api.minehut.com/servers").then((c) => {
- c.json().then((b: { servers: OnlineServer[] }) => {
- const filteredRes = b.servers.filter(
- (value) => value.name == info.name
- );
- if (filteredRes.length != 0) {
- events.emit("cmd-server", {
- serverName: filteredRes[0].name,
- serverObject: filteredRes[0],
- });
- } else {
- toast.error("Couldn't find server");
- }
- });
- });
- } else {
- isFavorited(info.name).then((b) => setStarred(b));
- setVB(false);
- setOpen(true);
- setObj(info);
- serverOwned(info.name).then((b) => setCustomized(b));
- }
- });
- events.on("cmd-offline-vb", (info: ServerResponse) => {
- if (info.online) {
- fetch("https://api.minehut.com/servers").then((c) => {
- c.json().then((b: { servers: OnlineServer[] }) => {
- const filteredRes = b.servers.filter(
- (value) => value.name == info.name
- );
- if (filteredRes.length != 0) {
- events.emit("cmd-server-vb", {
- serverName: filteredRes[0].name,
- serverObject: filteredRes[0],
- });
- } else {
- toast.error("Couldn't find server");
- }
- });
- });
- } else {
- isFavorited(info.name).then((b) => setStarred(b));
- setOpen(true);
- setVB(true);
- setObj(info);
- serverOwned(info.name).then((b) => setCustomized(b));
- }
- });
- }, []);
- return (
-
-
-
- {Object.keys(obj).length != 0 && (
-
-
- {(obj as ServerResponse).name}
-
-
-
-
- Server offline currently
-
-
-
-
-
- Created in {timeConverter((obj as ServerResponse).creation)}
-
-
- {(obj as OnlineServer).author != undefined && (
-
- by {(obj as OnlineServer).author}
-
- )}
-
-
-
-
-
- {" "}
-
- {(obj as OnlineServer).playerData.playerCount} online currently
-
-
-
-
-
- Created in{" "}
- {timeConverter(
- (serverSingle as ServerSingle).grabOffline()?.creation
- )}
-
-
- {owned && (
-
-
-
- Is customized by a MHSF User
-
-
- )}
-
- )}
-
-
- {
- router.push("/server/" + serverName + "/");
- setOpen(false);
- }}
- >
-
- Open Server Page
-
- {
- favoriteServer(serverName).then(() => {
- setStarred(!starred);
- toast.success("Done!");
- });
- }}
- disabled={!isSignedIn}
- >
-
- {!starred ? "F" : "Unf"}avorite Server
-
- {
- router.push("/server/" + serverName + "/statistics");
- setOpen(false);
- }}
- >
-
- See Statistics
-
-
-
- {
- setOpen(false);
- if (vb) events.emit("search-request-event-back");
- if (!vb) events.emit("search-request-event");
- }}
- >
-
- Go back
-
- {vb && (
- {
- setOpen(false);
- events.emit("cmd-event");
- }}
- >
-
- Back to main
-
- )}
-
-
-
- );
-}
-
-function timeConverter(UNIX_timestamp: any) {
- const a = new Date(UNIX_timestamp);
- const months = [
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- ];
- const year = a.getFullYear();
- const month = months[a.getMonth()];
- const date = a.getDate();
- const time = month + "/" + date + "/" + year;
- return time;
-}
-
-export function CommandBar() {
- const [open, setOpen] = useState(false);
- const clerk = useClerk();
- const { user } = useUser();
- useHotkeys("mod+k", () => setOpen(true), []);
-
- useEffectOnce(() => {
- events.on("cmd-event", () => {
- setOpen(true);
- });
- });
-
- return (
-
-
-
- No results found.
-
- {
- setOpen(false);
- events.emit("search-request-event-back");
- }}
- >
-
- Servers
-
-
- +Shift+K
-
-
- {
- setOpen(false);
- events.emit("cmd-event-link");
- }}
- >
-
- Links
-
- {
- setOpen(false);
- events.emit("cmd-ran-server");
- }}
- >
-
- Pick Random Server
-
-
-
-
- {
- events.emit("cmd-event-favorites");
- setOpen(false);
- }}
- >
-
- Favorites
-
- {
- try {
- clerk.openUserProfile();
- } catch {
- clerk.openSignIn();
- }
- }}
- >
-
- User Settings
-
-
-
-
- );
-}
-
-export function RandomServerDialog() {
- const [textCopied, setTextCopied] = useState(false);
- const [randomData, setRandomData] = useState(
- undefined
- );
- const [open, setOpen] = useState(false);
-
- useEffect(() => {
- events.on("cmd-ran-server", () => {
- setRandomData(undefined);
- setTextCopied(false);
- fetch("https://api.minehut.com/servers").then((c) =>
- c.json().then((b: { servers: OnlineServer[] }) => {
- setRandomData(
- b.servers[Math.floor(Math.random() * b.servers.length)]
- );
- setOpen(true);
- })
- );
- });
- }, []);
- const onChange = (state: boolean) => {
- if (state == false) {
- setOpen(false);
- events.emit("cmd-event");
- } else setOpen(state);
- };
-
- return (
-
- );
-}
-
-export function SubLinkCommandBar() {
- const [open, setOpen] = useState(false);
- const { resolvedTheme } = useTheme();
-
- useEffectOnce(() => {
- events.on("cmd-event-link", () => {
- setOpen(true);
- });
- });
-
- return (
-
-
-
- No results found.
-
-
- {
- window
- .open("https://github.com/DeveloLongScript/MHSF", "_blank")
- ?.focus();
- }}
- >
-
- GitHub
-
-
- {
- window.open("https://mhsf.betteruptime.com", "_blank")?.focus();
- }}
- >
-
- Status Page
-
-
-
- {
- setOpen(false);
- events.emit("cmd-event");
- }}
- >
-
- Go back
-
-
-
-
- );
-}
-const Github = (props: SVGProps) => (
-
-);
-export function FavoriteBar() {
- const [isOpen, setOpen] = useState(false);
- const [favorites, setFavorites] = useState | undefined>(
- undefined
- );
- const clerk = useClerk();
- const router = useRouter();
-
- useEffectOnce(() => {
- events.on("cmd-event-favorites", () => setOpen(true));
- getAccountFavorites().then((c) => setFavorites(c));
- });
-
- return (
-
-
-
- No results found.
-
-
- {favorites == undefined && (
- clerk.openSignIn()}>
- Login to see favorites
-
- )}
- {favorites != undefined && (
- <>
- {favorites.map((c) => (
- {
- router.push("/server/" + c);
- setOpen(false);
- }}
- >
- {c}
-
- ))}
- >
- )}
-
-
- {
- setOpen(false);
- events.emit("cmd-event");
- }}
- >
-
- Go back
-
-
-
-
- );
-}
-export function CommandBarer() {
- return (
- <>
-
-
-
-
-
-
-
- >
- );
-}
diff --git a/src/components/CustomizeRoot.tsx b/src/components/CustomizeRoot.tsx
deleted file mode 100644
index 5392f24..0000000
--- a/src/components/CustomizeRoot.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { useState } from "react";
-import ServerCustomize from "./ServerCustomize";
-import TabServer from "./misc/TabServer";
-
-export default function CustomizeRoot({
- params,
-}: {
- params: { server: string };
-}) {
- const [color, setColor] = useState("");
- return (
-
-
-
-
-
-
-
- );
-}
diff --git a/src/components/FavoritesView.tsx b/src/components/FavoritesView.tsx
deleted file mode 100644
index 8221fe5..0000000
--- a/src/components/FavoritesView.tsx
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { useState } from "react";
-import { Card, CardHeader, CardTitle } from "./ui/card";
-import type { ServerResponse } from "@/lib/types/mh-server";
-import { useEffectOnce } from "@/lib/useEffectOnce";
-import { Button } from "./ui/button";
-import { Copy, Layers, XIcon } from "lucide-react";
-import { toast } from "sonner";
-import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
-import { getAccountFavorites } from "@/lib/api";
-import { useRouter } from "@/lib/useRouter";
-import { Skeleton } from "./ui/skeleton";
-import FadeIn from "react-fade-in/lib/FadeIn";
-
-export default function FavoritesView() {
- const [apiFavorites, setApiFavorites] = useState([]);
- const [loading, setLoading] = useState(true);
- const router = useRouter();
-
- useEffectOnce(() => {
- getAccountFavorites().then((d) => {
- let num = 0;
- d.forEach((a: any, i: number) => {
- fetch("https://api.minehut.com/server/" + a + "?byName=true").then(
- (b) =>
- b.json().then((c) => {
- num++;
- const apiClone = apiFavorites;
- apiClone.push(c.server);
- setApiFavorites(apiClone);
- if (num === d.length) {
- setLoading(false);
- }
- })
- );
- });
- if (d.length === 0) setLoading(false);
- });
- });
-
- if (loading) {
- return (
- <>
-
-
- >
- );
-}
-
-function convert(value: number) {
- var result: string = value.toString();
- if (value >= 1000000) {
- result = Math.floor(value / 1000000) + "m";
- } else if (value >= 1000) {
- result = Math.floor(value / 1000) + "k";
- }
- return result;
-}
diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx
deleted file mode 100644
index fc93891..0000000
--- a/src/components/Icon.tsx
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { useTheme } from "next-themes";
-import type { SVGProps } from "react";
-
-/**
- * Returns a colorful version of the branding icon.
- *
- * The stored SVG file is at `/public/svg/icon-cf.svg`
- *
- * @param props The props for the SVG element.
- * @returns A JSX element representing the colorful branding icon.
- */
-export function BrandingColorfulIcon(props: SVGProps) {
- return (
-
- );
-}
-/**
- * Returns the optional Pride icon
- *
- * The stored SVG file is at `/public/svg/icon-p.svg`
- *
- * @param {SVGProps} props The props for the SVG element.
- * @returns A JSX element representing the branding icon.
- */
-export function BrandingPrideIcon(props: SVGProps) {
- return (
-
- );
-}
-
-/**
- * Returns the branding icon based on the current theme.
- *
- * If the theme is dark, the branding icon is a dark version of the logo.
- * If the theme is light, the branding icon is a light version of the logo.
- *
- * The stored SVG file is at `/public/svg/icon-gl.svg` or `/public/svg/icon-gd.svg`
- *
- * @param {SVGProps} props The props for the SVG element.
- *
- * @returns A JSX element representing the branding icon.
- */
-export function BrandingGenericIcon(props: SVGProps) {
- const { resolvedTheme } = useTheme();
-
- if (resolvedTheme == "dark") {
- return (
-
- );
- } else {
- return (
-
- );
- }
-}
-
-export function BadgeOfAffiliation(props: SVGProps) {
- return (
-
- );
-}
-
-export const Discord = (props: SVGProps) => (
-
-);
diff --git a/src/components/IconDisplay.tsx b/src/components/IconDisplay.tsx
deleted file mode 100644
index d0d1b02..0000000
--- a/src/components/IconDisplay.tsx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { useState, useEffect } from "react";
-
-export default function IconDisplay(props: {
- server: any;
- className?: string;
-}) {
- return (
-
-
-
- (this is the icon that loads in the lobby, the icon has not been
- picked)
-
- )}
-
-
- )}
- >
- );
-}
diff --git a/src/components/PreferencesSidebar.tsx b/src/components/PreferencesSidebar.tsx
deleted file mode 100644
index 630dabf..0000000
--- a/src/components/PreferencesSidebar.tsx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { useClerk } from "@clerk/nextjs";
-import { Cog, ExternalLink, KeyRound, Link, UserPen } from "lucide-react";
-import NextLink from "next/link";
-import { Button } from "./ui/button";
-import {
- ResizableHandle,
- ResizablePanel,
- ResizablePanelGroup,
-} from "./ui/resizable";
-
-export function Sidebar({
- children,
- curPage,
-}: {
- children: React.ReactNode;
- curPage: string;
-}) {
- const clerk = useClerk();
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {children}{" "}
-
-
- );
-}
diff --git a/src/components/SLCustomizePage.tsx b/src/components/SLCustomizePage.tsx
deleted file mode 100644
index a4faf87..0000000
--- a/src/components/SLCustomizePage.tsx
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-
-import { useEffect, useState } from "react";
-import {
- Card,
- CardContent,
- CardDescription,
- CardFooter,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
-import { Label } from "@/components/ui/label";
-import { Checkbox } from "@/components/ui/checkbox";
-import { Button } from "@/components/ui/button";
-import { Switch } from "./ui/switch";
-import { setAccountSL } from "@/lib/api";
-import { toast } from "sonner";
-import { useUser } from "@clerk/nextjs";
-
-export function SLCustomize() {
- const [padding, setPadding] = useState("0");
- const [itemsPerRow, setItemsPerRow] = useState("4");
- const [usePaddingOnSides, setUsePaddingOnSides] = useState(false);
- const [advanced, setAdvanced] = useState(false);
- const { user } = useUser();
-
- useEffect(() => {
- setItemsPerRow((user?.publicMetadata.ipr as string | undefined) || "4");
- setPadding((user?.publicMetadata.pad as string | undefined) || "0");
- setUsePaddingOnSides(
- (user?.publicMetadata.srv as boolean | undefined) || false
- );
- }, [
- user?.publicMetadata.srv,
- user?.publicMetadata.pad,
- user?.publicMetadata.ipr,
- ]);
-
- const handleSubmit = (e: React.FormEvent) => {
- e.preventDefault();
- if (padding) setAccountSL(Number(padding), "pad");
- if (usePaddingOnSides) setAccountSL(usePaddingOnSides, "srv");
- if (itemsPerRow) setAccountSL(Number(itemsPerRow), "ipr");
- toast.success("Set account preferences");
- };
-
- return (
-
-
-
-
-
- Server Display Settings
-
- Customize how servers are displayed in the list
-
-
- Create an account and link it to the owner of the server to
- customize it.
-
- )}
- {serverOwned && !userOwned && (
-
-
- Is this server in violation of the ECA?
-
- Is this server in violation of the{" "}
-
- External Content Agreement (aka ECA)
-
- ? You can report the server to remove the customizations from the
- server.
-
-
-
You don't have permission to customize this server.
- >
- )}
-
- {serverOwned && userOwned && (
-
-
-
- Description
-
- Edit the description of the server.
-
-
-
-
-
-
-
-
- Pick any color scheme for the components on your server page to
- use.
- >
- }
- button={
-
-
-
-
-
- {themes.map((colorObj) => {
- const color = colorObj.name;
- const theme = themes.find((theme) => theme.name === color);
- const isActive = cs === color;
-
- if (!theme) {
- return null;
- }
-
- return (
-
- );
- })}
-
-
- }
- />
-
-
-
- Banners appear on both the server list, and the server page.{" "}
-
- You will have to provide your own Imgur image for your image.
-
-
-
- By adding a banner, all images are subject to{" "}
-
- Minehuts Terms of Service
-
- ,{" "}
-
- Imgurs Terms of Service
- {" "}
- & the{" "}
-
- External Content Agreement
-
- .
-
- >
- }
- button={
-
-
-
-
-
-
-
-
- }
- />
-
-
-
- Associate a Discord server embed in your server page.
-
-
- By adding a Discord Server, all servers are subject to{" "}
-
- Discords Terms of Service
- {" "}
- & the{" "}
-
- External Content Agreement
-
- .
-
- >
- }
- button={
-
-
-
-
-
-
-
-
- }
- />
-
-
-
- By unowning the server, you will revert all customizations on
- the server and not be associated with the server.
- >
- }
- button={
-
- }
- />
-
-
-
- )}
- >
- );
-}
diff --git a/src/components/ServerList.tsx b/src/components/ServerList.tsx
deleted file mode 100644
index 3eee19d..0000000
--- a/src/components/ServerList.tsx
+++ /dev/null
@@ -1,1299 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { BorderBeam } from "@/components/effects/border-beam";
-import { Button } from "@/components/ui/button";
-import { AgGridReact, CustomCellRendererProps } from "ag-grid-react";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogHeader,
- DialogTitle,
- DialogTrigger,
-} from "@/components/ui/dialog";
-import {
- AllCommunityModule,
- ModuleRegistry,
- colorSchemeDarkBlue,
- colorSchemeLightWarm,
- themeQuartz,
-} from "ag-grid-community";
-import { Separator } from "@/components/ui/separator";
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { allTags } from "@/config/tags";
-import ServersList from "@/lib/list";
-import { OnlineServer } from "@/lib/types/mh-server";
-import useClipboard from "@/lib/useClipboard";
-import { useEffectOnce } from "@/lib/useEffectOnce";
-import { useRouter } from "@/lib/useRouter";
-import { cn } from "@/lib/utils";
-import { SignedIn, SignedOut, useUser } from "@clerk/nextjs";
-import { ChatBubbleIcon, InputIcon } from "@radix-ui/react-icons";
-import {
- ArrowDown,
- ArrowDownZA,
- Check,
- CircleUser,
- Copy,
- ImageIcon,
- Info,
- Layers,
- LogIn,
- Network,
- Sun,
- XIcon,
-} from "lucide-react";
-import { useTheme } from "next-themes";
-import Link from "next/link";
-import { useEffect, useRef, useState } from "react";
-import { toast } from "sonner";
-import InfiniteScroll from "react-infinite-scroll-component";
-import ClientFadeIn from "./ClientFadeIn";
-import IconDisplay from "./IconDisplay";
-import ServerCard from "./ServerCard";
-import Stat from "./Stat";
-import { SignInPopover } from "./clerk/SignInPopoverButton";
-import { BentoCard, BentoGrid } from "./effects/bento-grid";
-import Marquee from "./effects/marquee";
-import Particles from "./effects/particles";
-import SparklesText from "./effects/sparkles-text";
-import { pageFind } from "./misc/Link";
-import { Badge } from "./ui/badge";
-import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
-import { Skeleton } from "./ui/skeleton";
-import { LoadingSpinner } from "./ui/loading-spinner";
-import StickyTopbar from "./misc/StickyTopbar";
-import { HoverCard } from "@radix-ui/react-hover-card";
-import { HoverCardTrigger } from "./ui/hover-card";
-import { ExampleChart } from "./charts/ExampleChart";
-import ServerListInterface from "./misc/ServerListInterface";
-import NoItems from "./misc/NoItems";
-
-// ag-grid
-ModuleRegistry.registerModules([AllCommunityModule]);
-
-const themeLightWarm = themeQuartz.withPart(colorSchemeLightWarm);
-const themeDarkWarm = themeQuartz.withPart(colorSchemeDarkBlue);
-
-const features = [
- {
- Icon: ChatBubbleIcon,
- name: "Add a Discord widget",
- description:
- "Show where your players talk to each-other, including an online users count.",
- href: "/docs/guides/customization",
- cta: "Learn more",
- background: ,
- className: "lg:row-start-1 lg:row-end-2 lg:col-start-2 lg:col-end-3",
- },
- {
- Icon: InputIcon,
- name: "Descriptions",
- href: "/docs/guides/customization",
- cta: "Learn more",
- description:
- "Format your descriptions using Markdown to show what your server has to offer.",
- background: ,
- className: "lg:col-start-1 lg:col-end-2 lg:row-start-1 lg:row-end-2",
- },
- {
- Icon: ImageIcon,
- name: "Banners",
- href: "/docs/guides/customization",
- cta: "Learn more",
- description:
- "Show a banner with can contain images that show on your server page.",
- background: ,
- className: "lg:col-start-3 lg:col-end-4 lg:row-start-1 lg:row-end-2",
- },
-];
-
-export default function ServerList() {
- const [loading, setLoading]: any = useState(true);
- const [randomText, setRandomText] = useState("");
- const [motdList, setMotdList] = useState({});
- const allText = [""];
- const getRandomText = () => {
- return allText[Math.floor(Math.random() * allText.length)];
- };
- const [templateFilter, setTemplateFilter] = useState(false);
- const [random, setRandom] = useState(false);
- const [serverList, setServerList] = useState(new ServersList([]));
- const [textCopied, setTextCopied] = useState(false);
- const [padding, setPadding] = useState("0");
- const bigger = async (server: OnlineServer) =>
- server.playerData.playerCount > 15;
- const smaller = async (server: OnlineServer) =>
- !server.staticInfo.alwaysOnline &&
- server.playerData.playerCount < 15 &&
- server.playerData.playerCount > 7;
- const [nameFilters, setNameFilters] = useState({});
- const [inErrState, setErrState] = useState(false);
- const [servers, setServers] = useState>([]);
- const clipboard = useClipboard();
- const router = useRouter();
- const { user, isSignedIn } = useUser();
- const [pOS, setpOS] = useState(false);
- const [selectedProperties, setSelectedProperties] = useState([
- "Author",
- "MOTD",
- "Tags",
- "Players Online",
- "Actions",
- ]);
- const [ipr, setIPR] = useState("4");
- const [presentationMode, setPresentationMode] = useState<"table" | "grid">(
- "grid"
- );
- const [am, setAM] = useState(false);
- const [filters, setFilters] = useState<
- Array<(server: OnlineServer) => Promise>
- >([]);
- const [randomData, setRandomData] = useState(
- undefined
- );
- const { resolvedTheme } = useTheme();
- const [color, setColor] = useState("#ffffff");
-
- useEffect(() => {
- setColor(resolvedTheme === "dark" ? "#ffffff" : "#000000");
- }, [resolvedTheme]);
-
- useEffect(() => {
- if (isSignedIn) {
- setAM(true);
- console.log(user.publicMetadata);
-
- setIPR((user.publicMetadata.ipr as string | undefined) || "4");
- setPadding((user.publicMetadata.pad as string | undefined) || "0");
- setpOS((user.publicMetadata.srv as boolean | undefined) || false);
- }
- }, [isSignedIn, user]);
-
- useEffectOnce(() => {
- setRandomText(getRandomText());
- serverList
- .fetchDataAndFilter()
- .then(() => {
- serverList.moveListDown();
- let stringList: Array<{ server: string; motd: string }> = [];
- let obj: any = {};
-
- serverList.currentServers.forEach((b) => {
- stringList.push({ motd: b.motd, server: b.name });
- });
-
- serverList.getMOTDs(stringList).then((c) => {
- var updatedSL = motdList;
- c.forEach((b: { server: string; motd: string }) => {
- updatedSL[b.server] = b.motd;
- });
- setMotdList(updatedSL);
- setServers(serverList.currentServers);
- setLoading(false);
- });
- })
- .catch(() => setErrState(true));
- });
-
- const ref = useRef(null);
- const [clickedPage, setClickedPage] = useState("banners");
- const [hero, setHero] = useState(false);
- if (inErrState) {
- return (
- <>
-
-
-
-
-
- Hmm. Something is wrong. Reload the page.
-
- >
- );
- }
-
- if (loading) {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-
- return (
-
-
- <>
- {(!isSignedIn || hero) && (
-
-
-
- <>
- Meet MHSF, the modern
- server finder
- >
-
-
- MHSF is the next generation server list for Minehut, with
- interactive filters, {" "}
- intuitive keyboard shortcuts, and everything between.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- For players
-
-
-
-
- Find what you want now, not later
-
-
- Use interactive filters and customization modes to find the
- server of your choice
- in less than 10 minutes.
-
-
-
-
-
-
-
-
-
-
- For server owners
-
-
-
-
- Make your server stand out
-
-
- Servers can have custom banners, Discord widgets, color schemes,
- and descriptions, making your server stand out with information
- that can be shown to players.
-
- Ever wondered how a server was doing? MHSF constantly monitors
- servers and shows you statistics about how a server is doing at
- any point of time.
-
- {serverList.getExtraData().total_servers >= 3200 && (
-
-
-
-
-
- The server amount is over 3.2k, meaning that new servers
- have to go into a queue before being able to be online.{" "}
-
- (the server count isn't entirely accurate, so sometimes
- you might not go into a queue even when the server count
- is at 3.2k)
-
-
- )}
-
- );
-}
diff --git a/src/components/ServerView.tsx b/src/components/ServerView.tsx
deleted file mode 100644
index f2e498b..0000000
--- a/src/components/ServerView.tsx
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { useState, useEffect } from "react";
-import {
- CardContent,
- CardDescription,
- CardTitle,
- BetterHeader,
-} from "@/components/ui/card";
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { Badge } from "./ui/badge";
-import ServerSingle from "@/lib/single";
-import { motion } from "framer-motion";
-import { Cake, Check, Heart, Star, Users, X } from "lucide-react";
-import {
- favoriteServer,
- getCommunityServerFavorites,
- isFavorited,
-} from "@/lib/api";
-import { useTheme } from "next-themes";
-import { Skeleton } from "./ui/skeleton";
-import FadeIn from "react-fade-in/lib/FadeIn";
-import { Button } from "./ui/button";
-import IconDisplay from "./IconDisplay";
-import { useClerk, useUser } from "@clerk/nextjs";
-import { LoaderIcon } from "react-hot-toast";
-import { Separator } from "./ui/separator";
-import { convert } from "@/components/charts/NewChart";
-import { LoadingSpinner } from "./ui/loading-spinner";
-import { BadgeOfAffiliation } from "./Icon";
-
-export default function ServerView(props: { server: string }) {
- const [single, setSingle] = useState(new ServerSingle(props.server));
- const [loading, setLoading] = useState(true);
- const [favorited, setFavorited] = useState(false);
- const { resolvedTheme } = useTheme();
- const [loadingFavorite, setLoadingFavorite] = useState(false);
- const [randomText, setRandomText] = useState("");
- const [lastOnline, setLastOnline] = useState(0);
- const { isSignedIn } = useUser();
- const [communityFavorited, setCommunityFavorited] = useState(0);
- const clerk = useClerk();
- const [format, setFormat] = useState("");
- const [description, setDescription] = useState("");
- const allText = [""];
- const getRandomText = () => {
- return allText[Math.floor(Math.random() * allText.length)];
- };
-
- useEffect(() => {
- setRandomText(getRandomText());
-
- single.init().then(() => {
- isFavorited(single.grabOffline()?.name as string)
- .then((b) => {
- setFavorited(b);
- setLoading(false);
- var online = single.grabOffline()?.last_online;
- if (online != undefined) {
- setLastOnline(online);
- }
- })
- .catch(() => {
- setLoading(false);
- var online = single.grabOffline()?.last_online;
- if (online != undefined) {
- setLastOnline(online);
- }
- });
- getCommunityServerFavorites(single.grabOffline()?.name as string).then(
- (b) => {
- setCommunityFavorited(b);
- }
- );
- });
- }, []);
-
- if (loading) {
- return (
- <>
-
- This means that the server can{"'"}t loading some resources, like
- tags, icons and authors. However, all historical data still is
- stored and works.
-
-
-
- )}
-
-
-
-
-
-
-
-
- {single.grabOnline() == undefined &&
- !single.grabOffline()?.online ? (
-
- ) : (
-
- )}
- {props.server}
- {props.server === "CoreBoxx" && (
-
-
-
-
-
-
-
-
- CoreBoxx is an official affiliate of MHSF. This server was
- found to be a high-quality server and should be a
- good join for any player!
-
-
-
- )}
-
-
- {/* 1704088800000 is the Unix time (in milliseconds) of (GMT) Monday, January 1, 2024 6:00:00 AM */}
- {lastOnline < 1704088800000 &&
- single.grabOnline() == undefined && (
-
-
-
- Server too old to grab data
-
-
-
- This server was last online before 1/1/24 or{" "}
- (GMT) Monday, January 1, 2024 6:00:00 AM,
-
- meaning data like tags, authors and other information
- about the server cannot be seen.
-
-
- )}
-
- {single.getAuthor() != undefined ? (
-
-
- >
- );
-}
-
-function timeConverter(UNIX_timestamp: any) {
- var a = new Date(UNIX_timestamp);
- var months = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
- var year = a.getFullYear();
- var month = months[a.getMonth()];
- var date = a.getDate();
- var time = month + "/" + date + "/" + year;
- return time;
-}
diff --git a/src/components/Stat.tsx b/src/components/Stat.tsx
deleted file mode 100644
index 4e629b5..0000000
--- a/src/components/Stat.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-
-export default function Component(props: {
- title: string | JSX.Element;
- desc: string | JSX.Element;
- icon: any;
- className?: string;
- children?: any;
-}) {
- return (
-
- {props.children}
-
- {props.title}
-
-
-
-
{props.desc}
-
-
- );
-}
diff --git a/src/components/TextFromPathname.tsx b/src/components/TextFromPathname.tsx
deleted file mode 100644
index f08027e..0000000
--- a/src/components/TextFromPathname.tsx
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { usePathname } from "next/navigation";
-import {
- BreadcrumbItem,
- BreadcrumbPage,
- BreadcrumbSeparator,
-} from "./ui/breadcrumb";
-import { allDocs } from "contentlayer/generated";
-
-export default function TextFromPathname() {
- const pathname = usePathname();
-
- return (
- <>
- {pathname == "/" && (
- <>
-
-
- Home
-
- >
- )}
- {pathname?.startsWith("/server") && (
- <>
-
- Server
-
-
-
- {pathname.split("/server/")[1].split("/")[0]}
-
-
- {pathname.endsWith("/historical-data") && (
- <>
-
-
- Historical Data
-
- >
- )}
- {pathname.endsWith("/customize") && (
- <>
-
-
- Customize
-
- >
- )}
- >
- )}
- {pathname == "/account/favorites" && (
- <>
-
-
- Favorites
-
- >
- )}
- {pathname == "/account/claim-account" && (
- <>
-
-
- Claim Minecraft Account
-
- >
- )}
- {pathname == "/account/settings" && (
- <>
-
-
- Settings
-
- >
- )}
- {pathname == "/account/settings/options" && (
- <>
-
-
- Settings
-
-
-
- Preferences
-
- >
- )}
- {pathname == "/legal/external-content-agreement" && (
- <>
-
-
- Legal
-
-
-
- ECA Agreement
-
- >
- )}
- {pathname == "/sort/favorites" && (
- <>
-
- Sort
-
-
- Favorites
-
- >
- )}
- {pathname?.startsWith("/docs/") && (
- <>
-
- Docs
-
-
-
- {
- allDocs.find(
- (c) =>
- c._raw.flattenedPath ===
- pathname
- ?.split("/")
- .splice(2, pathname?.split("/").length)
- .join("/")
- )?.title
- }
-
-
- >
- )}
- >
- );
-}
diff --git a/src/components/ThemeProvider.tsx b/src/components/ThemeProvider.tsx
deleted file mode 100644
index fa7a23b..0000000
--- a/src/components/ThemeProvider.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-
-import * as React from "react";
-import { ThemeProvider as NextThemesProvider, useTheme } from "next-themes";
-import { type ThemeProviderProps } from "next-themes";
-import { usePathname } from "next/navigation";
-
-declare global {
- interface Document {
- startViewTransition(updateCallback: () => void):
- | {
- finished: Promise;
- ready: Promise;
- updateCallbackDone: Promise;
- }
- | undefined;
- }
-}
-
-export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
- const [mounted, setMounted] = React.useState(false);
- const pathname = usePathname();
-
- React.useEffect(() => {
- setMounted(true);
- }, []);
-
- if (!mounted) return null;
-
- return (
-
- {children}
-
- );
-}
-
-interface UseThemeTransitionResult {
- theme: string | undefined;
- changeTheme: (changeTheme: string) => void;
- mounted: boolean;
-}
-
-export function useThemeTransition(): UseThemeTransitionResult {
- const { theme, setTheme, systemTheme } = useTheme();
- const [mounted, setMounted] = React.useState(false);
-
- React.useEffect(() => {
- setMounted(true);
- }, []);
-
- const changeTheme = (changeTheme: string) => {
- if (!mounted) return;
-
- const resolvedTheme = theme === "system" ? systemTheme : changeTheme;
-
- if (document.startViewTransition) {
- document.startViewTransition(() => {
- const root = document.documentElement;
- root.style.setProperty(
- "--current-background",
- `var(--${resolvedTheme}-background)`
- );
- root.style.setProperty(
- "--current-foreground",
- `var(--${resolvedTheme}-foreground)`
- );
- setTheme(changeTheme);
- });
- } else {
- setTheme(changeTheme);
- }
- };
-
- React.useEffect(() => {
- if (mounted && theme) {
- const root = document.documentElement;
- root.style.setProperty(
- "--current-background",
- `var(--${theme}-background)`
- );
- root.style.setProperty(
- "--current-foreground",
- `var(--${theme}-foreground)`
- );
- }
- }, [mounted, theme]);
-
- return { theme, changeTheme, mounted };
-}
diff --git a/src/components/ThemeSwitcher.tsx b/src/components/ThemeSwitcher.tsx
deleted file mode 100644
index 298aa2d..0000000
--- a/src/components/ThemeSwitcher.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { Moon, Sun } from "lucide-react";
-
-import { Button } from "@/components/ui/button";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu";
-import { useThemeTransition } from "./ThemeProvider";
-import { usePathname } from "next/navigation";
-
-export function ModeToggle() {
- const { changeTheme } = useThemeTransition();
- const pathname = usePathname();
-
- return (
-
-
-
-
-
- {pathname?.startsWith("/server") && (
-
- For compatibility reasons, server pages are forced to dark
- mode
-
- )}
- changeTheme("light")}
- disabled={pathname?.startsWith("/server")}
- >
- Light
-
- changeTheme("dark")}
- disabled={pathname?.startsWith("/server")}
- >
- Dark
-
- changeTheme("system")}
- disabled={pathname?.startsWith("/server")}
- >
- System
-
-
-
- );
-}
diff --git a/src/components/charts/DailyChart.tsx b/src/components/charts/DailyChart.tsx
deleted file mode 100644
index cc189e2..0000000
--- a/src/components/charts/DailyChart.tsx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-"use client";
-
-import { TrendingDown, TrendingUp } from "lucide-react";
-import {
- Bar,
- BarChart,
- CartesianGrid,
- LabelList,
- Rectangle,
- XAxis,
- YAxis,
-} from "recharts";
-import { useEffect, useState } from "react";
-
-import {
- Card,
- CardContent,
- CardDescription,
- CardFooter,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-import {
- ChartConfig,
- ChartContainer,
- ChartTooltip,
- ChartTooltipContent,
-} from "@/components/ui/chart";
-import { Skeleton } from "../ui/skeleton";
-import { getDailyData, getMonthlyData } from "@/lib/api";
-import { useTrend } from "@/lib/hooks/use-daily-trend";
-
-const chartConfig = {
- result: {
- label: "Players",
- color: "hsl(var(--chart-3))",
- },
-} satisfies ChartConfig;
-
-export function DailyChart({ server }: { server: string }) {
- const [chartData, setChartData] = useState<{ day: string; result: number }[]>(
- [],
- );
- const [loading, setLoading] = useState(true);
- const { trend, percentage, success } = useTrend(chartData);
-
- useEffect(() => {
- getDailyData(server).then((c) => {
- setChartData(c);
- setLoading(false);
- });
- }, [server]);
-
- if (loading) return ;
-
- return (
-
-
- Average daily players
-
-
-
-
-
-
- value.slice(0, 3)}
- />
- }
- />
-
- c.day ===
- new Date().toLocaleDateString("en-US", { weekday: "long" }),
- )}
- activeBar={({ ...props }) => {
- return (
-
- );
- }}
- >
-
-
-
-
-
-
- {success ? (
-
- Trending up by 0% today{" "}
- (Insufficient data)
-
- )}
-
- Showing an average of all data for {server}
-
-
-
- );
-}
diff --git a/src/components/charts/ExampleChart.tsx b/src/components/charts/ExampleChart.tsx
deleted file mode 100644
index e18c3d6..0000000
--- a/src/components/charts/ExampleChart.tsx
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client"
-
-import * as React from "react"
-import { Area, AreaChart, CartesianGrid, XAxis } from "recharts"
-
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card"
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from "@/components/ui/chart"
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/components/ui/select"
-const chartData = [
- { date: "2024-04-01", player_count: 91 },
- { date: "2024-04-02", player_count: 106 },
- { date: "2024-04-03", player_count: 104 },
- { date: "2024-04-04", player_count: 111 },
- { date: "2024-04-05", player_count: 113 },
- { date: "2024-04-06", player_count: 114 },
- { date: "2024-04-07", player_count: 108 },
- { date: "2024-04-08", player_count: 89 },
- { date: "2024-04-09", player_count: 96 },
- { date: "2024-04-10", player_count: 123 },
- { date: "2024-04-11", player_count: 120 },
- { date: "2024-04-12", player_count: 140 },
- { date: "2024-04-13", player_count: 128 },
- { date: "2024-04-14", player_count: 130 },
- { date: "2024-04-15", player_count: 114 },
- { date: "2024-04-16", player_count: 98 },
- { date: "2024-04-17", player_count: 102 },
- { date: "2024-04-18", player_count: 103 },
- { date: "2024-04-19", player_count: 102 },
- { date: "2024-04-20", player_count: 112},
- { date: "2024-04-21", player_count: 117 },
- { date: "2024-04-22", player_count: 119 },
- { date: "2024-04-23", player_count: 129 },
- { date: "2024-04-24", player_count: 121 },
- { date: "2024-04-25", player_count: 126 },
- { date: "2024-04-26", player_count: 98},
- { date: "2024-04-27", player_count: 102 },
- { date: "2024-04-28", player_count: 100 },
- { date: "2024-04-29", player_count: 101 },
- { date: "2024-04-30", player_count: 104 },
- { date: "2024-05-01", player_count: 109 },
- { date: "2024-05-02", player_count: 86 },
- { date: "2024-05-03", player_count: 93 },
- { date: "2024-05-04", player_count: 108 },
- { date: "2024-05-05", player_count: 112 },
- { date: "2024-05-06", player_count: 111 },
- { date: "2024-05-07", player_count: 96 },
- { date: "2024-05-08", player_count: 100 },
- { date: "2024-05-09", player_count: 124 },
- { date: "2024-05-10", player_count: 134 },
- { date: "2024-05-11", player_count: 144 },
- { date: "2024-05-12", player_count: 156 },
- { date: "2024-05-13", player_count: 180 },
- { date: "2024-05-14", player_count: 167 },
- { date: "2024-05-15", player_count: 154 },
- { date: "2024-05-16", player_count: 124 },
- { date: "2024-05-17", player_count: 112 },
- { date: "2024-05-18", player_count: 114 },
- { date: "2024-05-19", player_count: 121 },
- { date: "2024-05-20", player_count: 96 },
- { date: "2024-05-21", player_count: 102 },
- { date: "2024-05-22", player_count: 131 },
-]
-
-const chartConfig = {
- player_count: {
- label: "Players",
- color: "hsl(var(--chart-1))",
- }
-} satisfies ChartConfig
-
-export function ExampleChart() {
-
- return (
-
-
-
- Player count over 3 months
-
-
-
-
-
-
-
-
-
-
-
-
- {
- const date = new Date(value)
- return date.toLocaleDateString("en-US", {
- month: "short",
- day: "numeric",
- })
- }}
- />
- {
- return new Date(value).toLocaleDateString("en-US", {
- month: "short",
- day: "numeric",
- })
- }}
- indicator="dot"
- />
- }
- />
-
- } />
-
-
-
-
- )
-}
diff --git a/src/components/charts/MonthlyChart.tsx b/src/components/charts/MonthlyChart.tsx
deleted file mode 100644
index 6293763..0000000
--- a/src/components/charts/MonthlyChart.tsx
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-"use client";
-
-import { TrendingDown, TrendingUp } from "lucide-react";
-import { Bar, BarChart, CartesianGrid, LabelList, Rectangle, XAxis, YAxis } from "recharts";
-import { useEffect, useState } from "react";
-
-import {
- Card,
- CardContent,
- CardDescription,
- CardFooter,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-import {
- ChartConfig,
- ChartContainer,
- ChartTooltip,
- ChartTooltipContent,
-} from "@/components/ui/chart";
-import { Skeleton } from "../ui/skeleton";
-import { useTrend } from "@/lib/hooks/use-trend";
-import { getMonthlyData } from "@/lib/api";
-
-const chartConfig = {
- result: {
- label: "Players",
- color: "hsl(var(--chart-3))",
- },
-} satisfies ChartConfig;
-
-export function MonthlyChart({ server }: { server: string }) {
- const [chartData, setChartData] = useState<
- { month: string; result: number }[]
- >([]);
- const [loading, setLoading] = useState(true);
- const { trend, percentage, success } = useTrend(chartData);
-
- useEffect(() => {
- getMonthlyData(server).then((c) => {
- setChartData(c);
- setLoading(false);
- });
- }, [server]);
-
- if (loading) return ;
-
- return (
-
-
- Average monthly players
-
-
-
-
-
-
- value.slice(0, 3)}
- />
- }
- />
-
- c.month ===
- new Date().toLocaleDateString("en-US", { month: "long" }),
- )}
- activeBar={({ ...props }) => {
- return (
-
- );
- }}>
-
-
-
-
-
-
- {success ? (
-
-
-
-
-
-
- {
- return `${new Date(value).getMonth() + 1}/${new Date(value).getDate()}`;
- }}
- />
- {
- return (
- value +
- (activeChart == "player_count"
- ? ` plyr${value != 1 ? "s" : ""}.`
- : ` ${value == 1 ? "favorite" : "favrts."}`)
- );
- }}
- domain={
- activeChart === "player_count" ? [0, dataMax + 10] : undefined
- }
- />
- {
- return `${new Date(value).toLocaleDateString("en-US", {
- day: "numeric",
- month: "short",
- })} ${new Date(value).toLocaleTimeString("en-US", {
- timeStyle: "short",
- })}`;
- }}
- />
- }
- />
- {activeChart === "player_count" && (
-
- )}
-
-
-
-
-
-
- );
-}
-
-export function convert(value: number) {
- var result: string = value.toString();
- if (value >= 1000000) {
- result = Math.floor(value / 1000000) + "m";
- } else if (value >= 1000) {
- result = Math.floor(value / 1000) + "k";
- }
- return result;
-}
diff --git a/src/components/charts/RelativeChart.tsx b/src/components/charts/RelativeChart.tsx
deleted file mode 100644
index ebc28f5..0000000
--- a/src/components/charts/RelativeChart.tsx
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { CartesianGrid, Line, LineChart, XAxis, YAxis } from "recharts";
-
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-import {
- ChartContainer,
- ChartTooltip,
- ChartTooltipContent,
-} from "@/components/ui/chart";
-import { Skeleton } from "../ui/skeleton";
-import { useEffect, useState } from "react";
-import { getRelativeServerData } from "@/lib/api";
-import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
-import { Info } from "lucide-react";
-
-export function RelativeChart({ server }: { server: string }) {
- const [chartData, setChartData] = useState<
- Array<{ relativePercentage: number; date: string }>
- >([]);
- const [loading, setLoading] = useState(true);
-
- useEffect(() => {
- getRelativeServerData(server).then((d) => {
- const newv: Array<{ relativePercentage: number; date: string }> = [];
-
- d.forEach((c) =>
- newv.push({
- relativePercentage: c.relativePrecentage * 100,
- date: c.date,
- })
- );
- setChartData(newv);
- setLoading(false);
- });
- }, [server]);
-
- if (loading)
- return (
- <>
-
- >
- );
-
- return (
-
-
- Relative percentage of {server}
-
- Shows the last 30 entries.{" "}
-
-
-
-
-
- This is the percentage of players on your server
- compared to the entire Minehut network.
- Server players / Minehut players
-
-
-
-
-
-
-
-
-
- `${new Date(value).toLocaleTimeString("en-US", {
- timeStyle: "short",
- })}`
- }
- />
- `${value}%`}
- />
- {
- return `${new Date(value).toLocaleDateString("en-US", {
- day: "numeric",
- month: "short",
- })} ${new Date(value).toLocaleTimeString("en-US", {
- timeStyle: "short",
- })}`;
- }}
- />
- }
- />
-
-
-
-
-
- );
-}
diff --git a/src/components/clerk/ClerkThemeProvider.tsx b/src/components/clerk/ClerkThemeProvider.tsx
deleted file mode 100644
index 0fa0e70..0000000
--- a/src/components/clerk/ClerkThemeProvider.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { ClerkProvider } from "@clerk/nextjs";
-import { dark } from "@clerk/themes";
-import { useTheme } from "next-themes";
-import { type ReactNode, useEffect, useState } from "react";
-import { ThemeProvider } from "../ThemeProvider";
-import Link from "next/link";
-
-export function ClerkThemeProvider({
- children,
- className,
-}: {
- children?: ReactNode | ReactNode[];
- className?: string | undefined;
-}) {
- const [theme, setTheme] = useState("");
-
- if (process.env.NEXT_PUBLIC_IS_AUTH !== "true")
- return (
-
-
- Non-authenticated environments are disallowed on this origin.
- Go to production
-
-
- );
-
- return (
-
-
-
-
- {children}
- {/** This *has* to be implemented in component form for the `useTheme` to load at the appropriate time. */}
-
-
-
-
-
- );
-}
-
-function ThemeElement({
- setTheme,
-}: {
- setTheme: (update: string | undefined) => void;
-}) {
- const theme = useTheme();
- useEffect(() => {
- setTheme(theme.resolvedTheme);
- }, [theme.resolvedTheme, setTheme]);
- return <>>;
-}
diff --git a/src/components/clerk/LoggedInPopover.tsx b/src/components/clerk/LoggedInPopover.tsx
deleted file mode 100644
index 585d72c..0000000
--- a/src/components/clerk/LoggedInPopover.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { useClerk, useUser } from "@clerk/nextjs";
-import { Button } from "../ui/button";
-import { Star, UserCog, X } from "lucide-react";
-import { useRouter } from "@/lib/useRouter";
-
-export default function LoggedInPopover() {
- const clerk = useClerk();
- const router = useRouter();
- const { user } = useUser();
-
- return (
-
- Logged in as {user?.username}
-
- Make comments about servers and favorite servers. Secured by Clerk
-
-
-
-
-
-
- );
-}
diff --git a/src/components/clerk/SignInPopoverButton.tsx b/src/components/clerk/SignInPopoverButton.tsx
deleted file mode 100644
index 67fc82f..0000000
--- a/src/components/clerk/SignInPopoverButton.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import {
- Popover,
- PopoverContent,
- PopoverTrigger,
-} from "@/components/ui/popover";
-import { Button } from "../ui/button";
-import { AtSign, LogIn, Ship } from "lucide-react";
-import { useClerk } from "@clerk/nextjs";
-import { useRouter } from "@/lib/useRouter";
-
-export default function SignInPopoverButton({
- className,
- variant,
-}: {
- className?: string;
- variant?:
- | "default"
- | "destructive"
- | "secondary"
- | "outline"
- | "ghost"
- | "link";
-}) {
- return (
-
-
-
-
-
-
-
-
- );
-}
-
-export function SignInPopover() {
- const clerk = useClerk();
- const router = useRouter();
- return (
-
- Login
-
- Customize your own servers and favorite other servers. Secured by Clerk
-
- If you created your account before Jan. 29, 2025, use the legacy migration button.
-
-
-
-
-
-
- );
-}
diff --git a/src/components/clerk/Topbar.tsx b/src/components/clerk/Topbar.tsx
deleted file mode 100644
index f7a3717..0000000
--- a/src/components/clerk/Topbar.tsx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { useClerk, useUser } from "@clerk/nextjs";
-import { SignedOut, SignedIn } from "@clerk/nextjs";
-import { Button } from "../ui/button";
-import { ModeToggle as ThemeSwitcher } from "../ThemeSwitcher";
-import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover";
-import Image from "next/image";
-import { CloudSnow, InfoIcon } from "lucide-react";
-import LoggedInPopover from "./LoggedInPopover";
-import SignInPopoverButton from "./SignInPopoverButton";
-import InfoPopover from "../misc/InfoPopover";
-
-export default function TopBar({ inter }: { inter: string }) {
- const clerk = useClerk();
- const { user } = useUser();
-
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
- );
-}
diff --git a/src/components/docs/NavUser.tsx b/src/components/docs/NavUser.tsx
deleted file mode 100644
index 87f0a6b..0000000
--- a/src/components/docs/NavUser.tsx
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-
-import {
- BadgeCheck,
- Bell,
- ChevronsUpDown,
- Computer,
- CreditCard,
- LogIn,
- LogOut,
- Moon,
- SettingsIcon,
- Sparkles,
- Sun,
-} from "lucide-react";
-
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
-import {
- DropdownMenu,
- DropdownMenuCheckboxItem,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuPortal,
- DropdownMenuRadioGroup,
- DropdownMenuRadioItem,
- DropdownMenuSeparator,
- DropdownMenuSub,
- DropdownMenuSubContent,
- DropdownMenuSubTrigger,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu";
-import {
- SidebarMenu,
- SidebarMenuButton,
- SidebarMenuItem,
- useSidebar,
-} from "@/components/ui/sidebar";
-import { useClerk, useUser } from "@clerk/nextjs";
-import { useTheme } from "next-themes";
-
-export function NavUser() {
- const { isMobile } = useSidebar();
- const { user, isSignedIn } = useUser();
- const clerk = useClerk();
- const { setTheme, theme } = useTheme();
-
- return (
-
-
-
-
-
- {isSignedIn && (
-
-
- ?
-
- )}
-
-
- >
- );
-}
diff --git a/src/components/docs/VersionSwitcher.tsx b/src/components/docs/VersionSwitcher.tsx
deleted file mode 100644
index ff6821e..0000000
--- a/src/components/docs/VersionSwitcher.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-"use client";
-
-import {
- Check,
- ChevronsUpDown,
- GalleryVerticalEnd,
- ServerCrashIcon,
-} from "lucide-react";
-import * as React from "react";
-
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu";
-import {
- SidebarMenu,
- SidebarMenuButton,
- SidebarMenuItem,
-} from "@/components/ui/sidebar";
-import { version } from "@/config/version";
-import { useRouter } from "@/lib/useRouter";
-
-export function VersionSwitcher() {
- const router = useRouter();
-
- return (
-
-
-
-
-
-
-
-
- Documentation
- v{version}
-
-
-
-
-
-
- router.push("/")}
- >
-
-
-
-
- MHSF
- v{version}
-
-
-
-
-
- );
-}
diff --git a/src/components/effects/bento-grid.tsx b/src/components/effects/bento-grid.tsx
deleted file mode 100644
index 8236f3f..0000000
--- a/src/components/effects/bento-grid.tsx
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { ReactNode } from "react";
-import { ArrowRightIcon } from "@radix-ui/react-icons";
-
-import { cn } from "@/lib/utils";
-import { Button } from "@/components/ui/button";
-
-const BentoGrid = ({
- children,
- className,
-}: {
- children: ReactNode;
- className?: string;
-}) => {
- return (
-
-);
-
-export { BentoCard, BentoGrid };
diff --git a/src/components/effects/border-beam.tsx b/src/components/effects/border-beam.tsx
deleted file mode 100644
index 12ca46f..0000000
--- a/src/components/effects/border-beam.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { cn } from "@/lib/utils";
-
-interface BorderBeamProps {
- className?: string;
- size?: number;
- duration?: number;
- borderWidth?: number;
- anchor?: number;
- colorFrom?: string;
- colorTo?: string;
- delay?: number;
-}
-
-export const BorderBeam = ({
- className,
- size = 200,
- duration = 15,
- anchor = 90,
- borderWidth = 1.5,
- colorFrom = "#ffaa40",
- colorTo = "#9c40ff",
- delay = 0,
-}: BorderBeamProps) => {
- return (
-
- );
-};
diff --git a/src/components/effects/confetti.tsx b/src/components/effects/confetti.tsx
deleted file mode 100644
index 6bbbdb4..0000000
--- a/src/components/effects/confetti.tsx
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import type { ReactNode } from "react";
-import React, {
- createContext,
- forwardRef,
- useCallback,
- useEffect,
- useImperativeHandle,
- useMemo,
- useRef,
-} from "react";
-import confetti from "canvas-confetti";
-import type {
- GlobalOptions as ConfettiGlobalOptions,
- CreateTypes as ConfettiInstance,
- Options as ConfettiOptions,
-} from "canvas-confetti";
-
-import { Button, ButtonProps } from "@/components/ui/button";
-
-type Api = {
- fire: (options?: ConfettiOptions) => void;
-};
-
-type Props = React.ComponentPropsWithRef<"canvas"> & {
- options?: ConfettiOptions;
- globalOptions?: ConfettiGlobalOptions;
- manualstart?: boolean;
- children?: ReactNode;
-};
-
-export type ConfettiRef = Api | null;
-
-const ConfettiContext = createContext({} as Api);
-
-const Confetti = forwardRef((props, ref) => {
- const {
- options,
- globalOptions = { resize: true, useWorker: true },
- manualstart = false,
- children,
- ...rest
- } = props;
- const instanceRef = useRef(null); // confetti instance
-
- const canvasRef = useCallback(
- // https://react.dev/reference/react-dom/components/common#ref-callback
- // https://reactjs.org/docs/refs-and-the-dom.html#callback-refs
- (node: HTMLCanvasElement) => {
- if (node !== null) {
- //
-
- );
-}
diff --git a/src/components/misc/InfoClaim.tsx b/src/components/misc/InfoClaim.tsx
deleted file mode 100644
index 8af94a4..0000000
--- a/src/components/misc/InfoClaim.tsx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs";
-import { Badge } from "../ui/badge";
-import Link from "next/link";
-import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
-import { ServerOff } from "lucide-react";
-
-export function ShowInfo() {
- return (
-
-
- Choose a method:
-
-
-
-
- CoreBoxx Recommended
-
-
- MHSFPV
-
-
-
-
-
-
- CoreBoxx
- {" "}
- has partnered with us to have an integrated account linking feature,
- which is also open all day.
-
-
-
-
-
- Server isn't online all day
-
- While joining MHSFPV, you may need to go into the lobby to start
- the server to then join.
-
-
-
-
- MHSFPV is a Minehut server dedicated to linking your account on
- MHSF.
-
-
-
-
- 1
-
-
- Join MHSFPV
-
- MHSFPV.minehut.gg
-
-
-
-
- 2
-
-
- Input the code in chat below
-
-
-
-
-
- );
-}
diff --git a/src/components/misc/InfoPopover.tsx b/src/components/misc/InfoPopover.tsx
deleted file mode 100644
index 29fb91a..0000000
--- a/src/components/misc/InfoPopover.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { Changelog } from "@/components/Changelog";
-import { changelog, version } from "@/config/version";
-import events from "@/lib/commandEvent";
-import { useRouter } from "@/lib/useRouter";
-import { Book, Calendar, Star, TerminalIcon } from "lucide-react";
-import { useState } from "react";
-import { Button } from "../ui/button";
-import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/dialog";
-import { ScrollArea } from "../ui/scroll-area";
-
-export default function InfoPopover() {
- const router = useRouter();
-
- return (
-
- The future of Minehut lists
-
- Use filters, intuitive keyboard shortcuts and other features for
- completely free, and *open-source. Currently on version{" "}
- {version}. {" "}
- * Licensed under the MIT License
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/components/misc/Link.tsx b/src/components/misc/Link.tsx
deleted file mode 100644
index 8b869d3..0000000
--- a/src/components/misc/Link.tsx
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import type { ReactNode } from "react";
-import { default as NextLink } from "next/link";
-import { Book, ExternalLink, NotebookText } from "lucide-react";
-
-export default function A({
- children,
- alt,
-}: {
- children: string;
- alt: string | ReactNode;
-}) {
- return (
-
- {(children || "").startsWith("Docs:") && (
-
- )}
- {(children || "").startsWith("Wiki:") && (
-
- )}
- {alt}
- {(children || "").startsWith("https") && (
-
- )}
-
- );
-}
-
-export function ALegacy({
- children,
- href,
-}: {
- children?: string | ReactNode;
- href?: string;
-}) {
- return (
-
- {(href || "").startsWith("Docs:") && (
-
- )}
- {(href || "").startsWith("Wiki:") && (
-
- )}
- {children}
- {(href || "").startsWith("https") && (
-
- )}
-
- );
-}
-
-export const pageFind = (text: string) => {
- if (text.startsWith("Docs:")) {
- return "/docs/" + text.substring(5).toLowerCase();
- }
- if (text === "Special:Root") return "/";
- if (text === "Special:Preferences") return "/account/settings";
- if (text === "Special:AccountOptions") return "/account/settings/options";
- if (text.startsWith("Server:") && text.endsWith("/Customization"))
- return "/server/" + text.substring(7, text.length - 14) + "/customization";
- if (text === "Special:ClerkConvertionPage") return process.env.NEXT_PUBLIC_CLERK_SWITCH_DOMAIN;
- if (text.startsWith("Server:")) return "/server/" + text.substring(7);
- if (text.startsWith("Wiki:"))
- return "https://minehut.wiki.gg/wiki/" + text.substring(5);
- if (text.startsWith("GitHub:"))
- return "https://github.com/" + text.substring(7);
- if (text === "Special:GitHub")
- return "https://github.com/DeveloLongScript/MHSF";
- if (text.startsWith("Special:GitHub/"))
- return "https://github.com/DeveloLongScript/MHSF/" + text.substring(15);
- return text;
-};
diff --git a/src/components/misc/LinkDialog.tsx b/src/components/misc/LinkDialog.tsx
deleted file mode 100644
index 875418e..0000000
--- a/src/components/misc/LinkDialog.tsx
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { ShowInfo } from "@/components/misc/InfoClaim";
-import { zodResolver } from "@hookform/resolvers/zod";
-import { useForm } from "react-hook-form";
-import { z } from "zod";
-import {
- Form,
- FormControl,
- FormDescription,
- FormField,
- FormItem,
- FormLabel,
- FormMessage,
-} from "@/components/ui/form";
-import { Button } from "@/components/ui/button";
-import {
- InputOTP,
- InputOTPGroup,
- InputOTPSlot,
-} from "@/components/ui/input-otp";
-import { linkMCAccount } from "@/lib/api";
-import { toast } from "sonner";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { SetStateAction, useState } from "react";
-import Confetti from "@/components/effects/confetti";
-
-const FormSchema = z.object({
- code: z.string().min(6, {
- message: "Your one-time password must be 6 characters.",
- }),
-});
-
-export default function CodeDialog({
- linked,
- setLinked,
-}: {
- linked: boolean;
- setLinked: (value: SetStateAction) => void;
-}) {
- const [name, setName] = useState("");
- const [dialog, setDialog] = useState(false);
- const form = useForm>({
- resolver: zodResolver(FormSchema),
- defaultValues: {
- code: "",
- },
- });
- async function onSubmit(data: z.infer) {
- const { code } = data;
- toast.promise(
- new Promise((g, b) => {
- linkMCAccount(code).then((c) => {
- console.log(c);
- if (c === undefined) {
- b();
- return;
- }
- g();
-
- setName(c);
- setDialog(true);
- setLinked(true);
- });
- }),
- {
- loading: "Linking account..",
- error: "Incorrect code",
- success: "Linked account!",
- }
- );
- }
-
- return (
-
- Link your account
-
-
-
-
-
-
-
-
- );
-}
diff --git a/src/components/misc/MDXElements.tsx b/src/components/misc/MDXElements.tsx
deleted file mode 100644
index 152a2ef..0000000
--- a/src/components/misc/MDXElements.tsx
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { Book, ExternalLink, NotebookText } from "lucide-react";
-import type { SVGProps } from "react";
-import { Card, CardContent } from "../ui/card";
-import { formalNames } from "@/config/achievements";
-
-type MDXElementType = {
- [key: string]: (props: any) => JSX.Element;
-};
-
-const Discord = (props: SVGProps) => (
-
-);
-function AchievementPreview({ title }: { title: string }) {
- const Icon = formalNames[title].icon;
- return (
-
- );
-}
-
-export const MDXElements: MDXElementType = {
- Discord,
- AchievementPreview,
- Book: (props) => ,
- Notebook: (props) => ,
- ExternalLink: (props) => ,
-};
diff --git a/src/components/misc/MiniJoinsChart.tsx b/src/components/misc/MiniJoinsChart.tsx
deleted file mode 100644
index ed7bef1..0000000
--- a/src/components/misc/MiniJoinsChart.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import {
- type ChartConfig,
- ChartContainer,
- ChartTooltip,
- ChartTooltipContent,
-} from "@/components/ui/chart";
-import { getShortTermData } from "@/lib/api";
-import { useEffectOnce } from "@/lib/useEffectOnce";
-import * as React from "react";
-import { CartesianGrid, Line, LineChart, XAxis, YAxis } from "recharts";
-
-const chartConfig = {
- player_count: {
- label: "Joins",
- color: "hsl(var(--chart-1))",
- },
-} satisfies ChartConfig;
-
-export function MiniJoinsChart({ server }: { server: string }) {
- const [chartData, setChartData] = React.useState([]);
- const [loading, setLoading] = React.useState(true);
-
- useEffectOnce(() => {
- getShortTermData(server, ["player_count", "date"]).then((result) => {
- setChartData(result.data.slice(-20));
- setLoading(false);
- });
- });
-
- return (
-
- );
-}
diff --git a/src/components/misc/NewDomainDialog.tsx b/src/components/misc/NewDomainDialog.tsx
deleted file mode 100644
index d7426bb..0000000
--- a/src/components/misc/NewDomainDialog.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-"use client";
-
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { useSearchParams } from "next/navigation";
-import { useEffect, useState } from "react";
-
-export default function NewDomainDialog() {
- const searchParams = useSearchParams();
- const toShow = searchParams?.get("newDomain") === "true";
- const [open, setOpen] = useState(false);
-
- useEffect(() => {
- if (toShow) setOpen(true);
- }, [toShow]);
-
- return (
-
- );
-}
diff --git a/src/components/misc/NoItems.tsx b/src/components/misc/NoItems.tsx
deleted file mode 100644
index ed71f8c..0000000
--- a/src/components/misc/NoItems.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-"use client";
-
-import { DatabaseZap } from "lucide-react";
-
-export default function NoItems({ title }: { title?: string }) {
- return (
- <>
-
-
-
- {title
- ? title
- : "Huh, we tried to find something, but nothing was found."}
-
-
- >
- );
-}
diff --git a/src/components/misc/ServerListInterface.tsx b/src/components/misc/ServerListInterface.tsx
deleted file mode 100644
index aac44bb..0000000
--- a/src/components/misc/ServerListInterface.tsx
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import { Button } from "@/components/ui/button";
-import { Input } from "@/components/ui/input";
-import {
- ChevronDown,
- Dices,
- ListRestart,
- MoreVertical,
- Search,
- SquareTerminal,
-} from "lucide-react";
-import { FilterMenu } from "./FilterMenu";
-import { DisplaySettings } from "./DisplaySettings";
-import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
-import events from "@/lib/commandEvent";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
-} from "../ui/dropdown-menu";
-
-export default function ServerListInterface({
- linksProps,
- viewProps,
- refreshCallback,
- pickRandomServerCallback,
-}: {
- linksProps: {
- serverSizeChangerCallback: any;
- serverSizeChangerValueCallback: any;
- templateFilter: any;
- tagChangerValueCallback: any;
- tagChangerCallback: any;
- categoryChangerCallback: any;
- categoryChangerValueCallback: any;
- };
- viewProps: {
- setPresentationMode: any;
- presentationMode: any;
- selectedProperties: any;
- setSelectedProperties: any;
- hero: any;
- setHero: any;
- iprChangerCallback: any;
- ipr: any;
- am: any;
- padding: any;
- paddingChangerCallback: any;
- };
- refreshCallback: any;
- pickRandomServerCallback: any;
-}) {
- return (
-
-
-
-
-
-
-
-
- Reload Servers
-
-
-
- Pick Random Server
-
-
- events.emit("cmd-event")}
- >
-
- Show Command Bar
-
-
-
-
-
-
- );
-}
diff --git a/src/components/misc/StickyTopbar.tsx b/src/components/misc/StickyTopbar.tsx
deleted file mode 100644
index 2898c10..0000000
--- a/src/components/misc/StickyTopbar.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://mhsf.app/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import useTotalBannerSize from "@/lib/hooks/use-total-banner-size";
-import { useEffect, useState, ReactNode } from "react";
-
-export default function StickyTopbar({
- children,
- scrollElevation,
- className,
-}: {
- children: ReactNode;
- scrollElevation: number;
- className?: string;
-}) {
- const [isSticky, setIsSticky] = useState(false);
- const { bannerSize } = useTotalBannerSize();
-
- const handleScroll = () => {
- if (window.scrollY > scrollElevation) {
- setIsSticky(true);
- } else {
- setIsSticky(false);
- }
- };
-
- useEffect(() => {
- window.addEventListener("scroll", handleScroll);
- return () => {
- window.removeEventListener("scroll", handleScroll);
- };
- }, []);
-
- return (
-
- {children}
-
- );
-}
diff --git a/src/components/misc/SwitchEnvPopup.tsx b/src/components/misc/SwitchEnvPopup.tsx
deleted file mode 100644
index ba8115e..0000000
--- a/src/components/misc/SwitchEnvPopup.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-"use client";
-
-import { useEffect, useState } from "react";
-import {
- Dialog,
- DialogContent,
- DialogTitle,
- DialogTrigger,
-} from "../ui/dialog";
-import { OctagonAlert } from "lucide-react";
-import A from "./Link";
-import { Button } from "../ui/button";
-import { useRouter } from "@/lib/useRouter";
-
-export function SwitchEnvPopup() {
- const [open, setOpen] = useState(false);
- const router = useRouter();
-
- useEffect(() => {
- if (localStorage.getItem("mhsf--switch-env-alert") !== "true") {
- setOpen(true);
- }
- }, [])
-
- const setDialogTrigger = (v: boolean) => {
- setOpen(v)
- if (!v) {
- localStorage.setItem("mhsf--switch-env-alert", "true")
- }
- }
-
- return (
-
- );
-}
diff --git a/src/components/misc/TabServer.tsx b/src/components/misc/TabServer.tsx
deleted file mode 100644
index 2397c06..0000000
--- a/src/components/misc/TabServer.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { useState } from "react";
-import { Tabs, TabsList, TabsTrigger } from "../ui/tabs";
-import { useRouter } from "@/lib/useRouter";
-import { CornerDownLeft, Database, Home, Paintbrush } from "lucide-react";
-
-export default function TabServer({
- server,
- tabDef,
-}: {
- server: string;
- tabDef: string;
-}) {
- const [tab, setTab] = useState(tabDef);
- const router = useRouter();
-
- return (
-
- {
- setTab(tac);
- if (tac == "customize") router.push(`/server/${server}/customize`);
- if (tac == "statistics") router.push(`/server/${server}/statistics`);
- if (tac == "general") router.push(`/server/${server}`);
- if (tac == "server-list") router.push("/");
- }}
- >
-
-
- {" "}
-
General Information
-
-
-
-
Statistics
-
-
-
-
Customization
-
-
-
-
-
-
Back to server list
-
-
-
-
- );
-}
diff --git a/src/components/misc/TextCopyComp.tsx b/src/components/misc/TextCopyComp.tsx
deleted file mode 100644
index dc2d85f..0000000
--- a/src/components/misc/TextCopyComp.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-import { useState } from "react";
-import { Button } from "../ui/button";
-import { toast } from "sonner";
-import { Check } from "lucide-react";
-import useClipboard from "@/lib/useClipboard";
-
-export function TextCopyComp() {
- "use client";
- const clipboard = useClipboard();
- const [textCopied, setTextCopied] = useState(false);
-
- return (
-
- MHSFPV.minehut.gg{" "}
-
-
- );
-}
diff --git a/src/components/misc/ThemedToaster.tsx b/src/components/misc/ThemedToaster.tsx
deleted file mode 100644
index 9771f60..0000000
--- a/src/components/misc/ThemedToaster.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client";
-
-import { useTheme } from "next-themes";
-import { Toaster } from "../ui/sonner";
-
-export default function ThemedToaster() {
- const { resolvedTheme } = useTheme();
-
- return ;
-}
diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsx
deleted file mode 100644
index 5afd41d..0000000
--- a/src/components/ui/alert.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import * as React from "react"
-import { cva, type VariantProps } from "class-variance-authority"
-
-import { cn } from "@/lib/utils"
-
-const alertVariants = cva(
- "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
- {
- variants: {
- variant: {
- default: "bg-background text-foreground",
- destructive:
- "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
- },
- },
- defaultVariants: {
- variant: "default",
- },
- }
-)
-
-const Alert = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes & VariantProps
->(({ className, variant, ...props }, ref) => (
-
-))
-Alert.displayName = "Alert"
-
-const AlertTitle = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
-AlertTitle.displayName = "AlertTitle"
-
-const AlertDescription = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-))
-AlertDescription.displayName = "AlertDescription"
-
-export { Alert, AlertTitle, AlertDescription }
diff --git a/src/components/ui/aspect-ratio.tsx b/src/components/ui/aspect-ratio.tsx
deleted file mode 100644
index d6a5226..0000000
--- a/src/components/ui/aspect-ratio.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-"use client"
-
-import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
-
-const AspectRatio = AspectRatioPrimitive.Root
-
-export { AspectRatio }
diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx
deleted file mode 100644
index 51e507b..0000000
--- a/src/components/ui/avatar.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-"use client"
-
-import * as React from "react"
-import * as AvatarPrimitive from "@radix-ui/react-avatar"
-
-import { cn } from "@/lib/utils"
-
-const Avatar = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
-Avatar.displayName = AvatarPrimitive.Root.displayName
-
-const AvatarImage = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
-AvatarImage.displayName = AvatarPrimitive.Image.displayName
-
-const AvatarFallback = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, ...props }, ref) => (
-
-))
-AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
-
-export { Avatar, AvatarImage, AvatarFallback }
diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx
deleted file mode 100644
index 1a7dfb5..0000000
--- a/src/components/ui/badge.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import * as React from "react";
-import { cva, type VariantProps } from "class-variance-authority";
-
-import { cn } from "@/lib/utils";
-
-const badgeVariants = cva(
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
- {
- variants: {
- variant: {
- default:
- "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
- secondary:
- "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
- // All custom colors in MHSF
- red: "border-transparent bg-red-300 text-primary-foreground hover:bg-red-300/80",
- orange:
- "border-transparent bg-orange-300 text-primary-foreground hover:bg-orange-300/80",
- yellow:
- "border-transparent bg-yellow-300 text-primary-foreground hover:bg-yellow-300/80",
- green:
- "border-transparent bg-green-300 text-primary-foreground hover:bg-green-300/80",
- lime: "border-transparent bg-lime-300 text-primary-foreground hover:bg-lime-300/80",
- blue: "border-transparent bg-blue-300 text-primary-foreground hover:bg-blue-300/80",
- teal: "border-transparent bg-teal-300 text-primary-foreground hover:bg-teal-300/80",
- cyan: "border-transparent bg-cyan-300 text-primary-foreground hover:bg-cyan-300/80",
- violet:
- "border-transparent bg-violet-300 text-primary-foreground hover:bg-violet-300/80",
- indigo:
- "border-transparent bg-indigo-300 text-primary-foreground hover:bg-indigo-300/80",
- purple:
- "border-transparent bg-purple-300 text-primary-foreground hover:bg-purple-300/80",
- fuchsia:
- "border-transparent bg-fuchsia-300 text-primary-foreground hover:bg-fuchsia-300/80",
- pink: "border-transparent bg-pink-300 text-primary-foreground hover:bg-pink-300/80",
- // End
- destructive:
- "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
- outline: "text-foreground",
- },
- },
- defaultVariants: {
- variant: "default",
- },
- },
-);
-
-export interface BadgeProps
- extends React.HTMLAttributes,
- VariantProps {}
-
-function Badge({ className, variant, ...props }: BadgeProps) {
- return (
-
- );
-}
-
-export { Badge, badgeVariants };
diff --git a/src/components/ui/breadcrumb.tsx b/src/components/ui/breadcrumb.tsx
deleted file mode 100644
index 00c2f49..0000000
--- a/src/components/ui/breadcrumb.tsx
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
-import { ChevronRight, MoreHorizontal } from "lucide-react"
-
-import { cn } from "@/lib/utils"
-
-const Breadcrumb = React.forwardRef<
- HTMLElement,
- React.ComponentPropsWithoutRef<"nav"> & {
- separator?: React.ReactNode
- }
->(({ ...props }, ref) => )
-Breadcrumb.displayName = "Breadcrumb"
-
-const BreadcrumbList = React.forwardRef<
- HTMLOListElement,
- React.ComponentPropsWithoutRef<"ol">
->(({ className, ...props }, ref) => (
-
-))
-BreadcrumbList.displayName = "BreadcrumbList"
-
-const BreadcrumbItem = React.forwardRef<
- HTMLLIElement,
- React.ComponentPropsWithoutRef<"li">
->(({ className, ...props }, ref) => (
-
-))
-BreadcrumbItem.displayName = "BreadcrumbItem"
-
-const BreadcrumbLink = React.forwardRef<
- HTMLAnchorElement,
- React.ComponentPropsWithoutRef<"a"> & {
- asChild?: boolean
- }
->(({ asChild, className, ...props }, ref) => {
- const Comp = asChild ? Slot : "a"
-
- return (
-
- )
-})
-BreadcrumbLink.displayName = "BreadcrumbLink"
-
-const BreadcrumbPage = React.forwardRef<
- HTMLSpanElement,
- React.ComponentPropsWithoutRef<"span">
->(({ className, ...props }, ref) => (
-
-))
-BreadcrumbPage.displayName = "BreadcrumbPage"
-
-const BreadcrumbSeparator = ({
- children,
- className,
- ...props
-}: React.ComponentProps<"li">) => (
-
-)
-BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
-
-const BreadcrumbEllipsis = ({
- className,
- ...props
-}: React.ComponentProps<"span">) => (
-
-
- More
-
-)
-BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
-
-export {
- Breadcrumb,
- BreadcrumbList,
- BreadcrumbItem,
- BreadcrumbLink,
- BreadcrumbPage,
- BreadcrumbSeparator,
- BreadcrumbEllipsis,
-}
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx
deleted file mode 100644
index d3b29c9..0000000
--- a/src/components/ui/button.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import * as React from "react";
-import { Slot } from "@radix-ui/react-slot";
-import { cva, type VariantProps } from "class-variance-authority";
-
-import { cn } from "@/lib/utils";
-
-const buttonVariants = cva(
- "inline-flex items-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
- {
- variants: {
- variant: {
- default:
- "bg-primary text-primary-foreground hover:bg-primary/90 focus:ring-4 focus:ring-neutral-300 focus:ring-offset-current dark:focus:ring-neutral-500 duration-150 ease-in-out transition-all",
- destructive:
- "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-4 focus:ring-red-300 focus:ring-offset-current dark:focus:ring-red-950 duration-150 ease-in-out transition-all",
- outline:
- "border border-input bg-background hover:bg-accent hover:text-accent-foreground focus:ring-4 focus:ring-neutral-100 focus:ring-offset-current dark:focus:ring-neutral-900 duration-150 ease-in-out transition-all",
- secondary:
- "bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:ring-4 focus:ring-neutral-300 focus:ring-offset-current dark:focus:ring-neutral-500 duration-150 ease-in-out transition-all",
- ghost:
- "hover:bg-accent hover:text-accent-foreground focus:ring-4 focus:ring-neutral-100 focus:ring-offset-current dark:focus:ring-neutral-900 duration-150 ease-in-out transition-all",
- link: "text-primary underline-offset-4 hover:underline",
- favorite:
- "text-black rounded-lg hover:bg-primary/90 focus:ring-4 focus:ring-yellow-400/60 focus:ring-offset-current dark:focus:ring-yellow-400/60 duration-150 ease-in-out transition-all bg-gradient-to-bl from-yellow-300 via-yellow-500 to-yellow-100",
- },
- size: {
- default: "h-10 px-4 py-2",
- sm: "h-9 rounded-md px-3",
- lg: "h-11 rounded-md px-8",
- icon: "h-10 w-10",
- },
- },
- defaultVariants: {
- variant: "default",
- size: "default",
- },
- }
-);
-
-export interface ButtonProps
- extends React.ButtonHTMLAttributes,
- VariantProps {
- asChild?: boolean;
- noJustify?: boolean;
-}
-
-const Button = React.forwardRef(
- (
- { className, variant, size, asChild = false, noJustify = false, ...props },
- ref
- ) => {
- const Comp = asChild ? Slot : "button";
- return (
-
- );
- }
-);
-Button.displayName = "Button";
-
-export { Button, buttonVariants };
diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx
deleted file mode 100644
index ab79d5f..0000000
--- a/src/components/ui/card.tsx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-import * as React from "react";
-
-import { cn } from "@/lib/utils";
-import { Button } from "./button";
-
-const Card = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-));
-Card.displayName = "Card";
-
-const CardHeader = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-));
-CardHeader.displayName = "CardHeader";
-
-const BetterHeader = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-));
-BetterHeader.displayName = "CardHeader";
-
-const CardTitle = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-));
-CardTitle.displayName = "CardTitle";
-
-const CardDescription = React.forwardRef<
- HTMLParagraphElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-));
-CardDescription.displayName = "CardDescription";
-
-const CardContent = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-));
-CardContent.displayName = "CardContent";
-
-const CardFooter = React.forwardRef<
- HTMLDivElement,
- React.HTMLAttributes
->(({ className, ...props }, ref) => (
-
-));
-CardFooter.displayName = "CardFooter";
-
-export {
- Card,
- CardHeader,
- CardFooter,
- CardTitle,
- CardDescription,
- CardContent,
- BetterHeader,
-};
diff --git a/src/components/ui/chart.tsx b/src/components/ui/chart.tsx
deleted file mode 100644
index 1a6cad8..0000000
--- a/src/components/ui/chart.tsx
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * MHSF, Minehut Server List
- * All external content is rather licensed under the ECA Agreement
- * located here: https://list.mlnehut.com/docs/legal/external-content-agreement
- *
- * All code under MHSF is licensed under the MIT License
- * by open source contributors
- *
- * Copyright (c) 2024 dvelo
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-"use client"
-
-import * as React from "react"
-import * as RechartsPrimitive from "recharts"
-
-import { cn } from "@/lib/utils"
-
-// Format: { THEME_NAME: CSS_SELECTOR }
-const THEMES = { light: "", dark: ".dark" } as const
-
-export type ChartConfig = {
- [k in string]: {
- label?: React.ReactNode
- icon?: React.ComponentType
- } & (
- | { color?: string; theme?: never }
- | { color?: never; theme: Record }
- )
-}
-
-type ChartContextProps = {
- config: ChartConfig
-}
-
-const ChartContext = React.createContext(null)
-
-function useChart() {
- const context = React.useContext(ChartContext)
-
- if (!context) {
- throw new Error("useChart must be used within a ")
- }
-
- return context
-}
-
-const ChartContainer = React.forwardRef<
- HTMLDivElement,
- React.ComponentProps<"div"> & {
- config: ChartConfig
- children: React.ComponentProps<
- typeof RechartsPrimitive.ResponsiveContainer
- >["children"]
- }
->(({ id, className, children, config, ...props }, ref) => {
- const uniqueId = React.useId()
- const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`
-
- return (
-
-