refactor(settings): refactored the admincheck so we can reuse it

This commit is contained in:
2025-03-19 17:08:22 -05:00
parent 0914b53341
commit ca0ba7fe59
5 changed files with 54 additions and 30 deletions

View File

@@ -9,6 +9,7 @@ import {useQuery} from "@tanstack/react-query";
import {useRouter} from "@tanstack/react-router";
import {format} from "date-fns";
import UpdateServer from "./UpdateServer";
import {adminUrlCheck} from "@/utils/adminUrlCheck";
export type Servers = {
server_id?: string;
@@ -85,9 +86,7 @@ export default function ServerPage() {
{format(server.lastUpdated, "MM/dd/yyyy hh:mm")}
</TableCell>
<TableCell className="font-medium">
{window.location.host.split(":")[0] === "localhost" && (
<UpdateServer server={server} token={token as string} />
)}
{adminUrlCheck() && <UpdateServer server={server} token={token as string} />}
</TableCell>
</TableRow>
))}

View File

@@ -37,7 +37,7 @@ export default function SettingsPage() {
}
return (
<LstCard className="m-2 flex place-content-center w-dvh">
<LstCard className="m-2 flex place-content-center w-fit">
<Table>
<TableHeader>
<TableRow>