plane/god-mode/app/page.tsx

42 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-02-15 06:51:19 +00:00
"use client";
import useSWR from "swr";
import useSWRImmutable from "swr/immutable";
// hooks
import useUser from "hooks/use-user";
import useInstance from "hooks/use-instance";
// components
2024-01-31 08:33:52 +00:00
import { GeneralView } from "components/views";
export default function Home() {
2024-02-15 06:51:19 +00:00
const {
// isUserInstanceAdmin,
fetchCurrentUser,
fetchCurrentUserInstanceAdminStatus,
} = useUser();
const { fetchInstanceInfo, fetchInstanceAdmins } = useInstance();
// fetching user information
useSWR("CURRENT_USER_DETAILS", () => fetchCurrentUser(), {
shouldRetryOnError: false,
});
// fetching current user instance admin status
useSWRImmutable(
"CURRENT_USER_INSTANCE_ADMIN_STATUS",
() => fetchCurrentUserInstanceAdminStatus(),
{
shouldRetryOnError: false,
}
);
// fetching instance information
useSWR("INSTANCE_INFO", () => fetchInstanceInfo());
// fetching instance admins
useSWR("INSTANCE_ADMINS", () => fetchInstanceAdmins());
2024-01-31 08:33:52 +00:00
return (
<div className="flex">
<GeneralView />
</div>
);
}