refactor(settings): refactored the admincheck so we can reuse it
This commit is contained in:
@@ -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>
|
||||
))}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user