-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathadmin.back-office._index.tsx
More file actions
29 lines (27 loc) · 1.02 KB
/
admin.back-office._index.tsx
File metadata and controls
29 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type { LoaderFunctionArgs } from "@remix-run/server-runtime";
import { redirect, typedjson } from "remix-typedjson";
import { LinkButton } from "~/components/primitives/Buttons";
import { Header2 } from "~/components/primitives/Headers";
import { Paragraph } from "~/components/primitives/Paragraph";
import { requireUser } from "~/services/session.server";
export async function loader({ request }: LoaderFunctionArgs) {
const user = await requireUser(request);
if (!user.admin) {
return redirect("/");
}
return typedjson({});
}
export default function BackOfficeIndex() {
return (
<div className="flex flex-col items-start gap-3 py-6">
<Header2>Back office</Header2>
<Paragraph variant="base" className="max-w-prose">
Back-office actions are applied to a single organization. Pick an org from the
Organizations tab to open its detail page.
</Paragraph>
<LinkButton to="/admin/orgs" variant="primary/medium">
Pick an organization
</LinkButton>
</div>
);
}