App directory #4

This commit is contained in:
Darren Clarke 2023-06-28 12:55:24 +00:00 committed by GitHub
parent 69706053c6
commit 4d743c5e67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 223 additions and 107 deletions

View file

@ -0,0 +1,29 @@
"use client";
import { FC } from "react";
import {
SimpleForm,
TextInput,
BooleanInput,
Create,
CreateProps,
} from "react-admin";
import { useSession } from "next-auth/react";
import { UserRoleInput } from "./shared";
const UserCreate: FC<CreateProps> = () => {
const { data: session } = useSession();
return (
<Create title="Create Users">
<SimpleForm>
<TextInput source="email" />
<TextInput source="name" />
<UserRoleInput session={session} initialValue="NONE" />
<BooleanInput source="isActive" defaultValue={true} />
<TextInput source="createdBy" defaultValue={session?.user?.name} />
</SimpleForm>
</Create>
);
};
export default UserCreate;