2023-06-28 12:55:24 +00:00
|
|
|
"use client";
|
|
|
|
|
|
2023-02-13 12:41:30 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
|
import {
|
|
|
|
|
SimpleForm,
|
|
|
|
|
TextInput,
|
|
|
|
|
BooleanInput,
|
|
|
|
|
Create,
|
|
|
|
|
CreateProps,
|
|
|
|
|
} from "react-admin";
|
|
|
|
|
import { useSession } from "next-auth/react";
|
|
|
|
|
import { UserRoleInput } from "./shared";
|
|
|
|
|
|
2023-06-07 12:14:12 +00:00
|
|
|
const UserCreate: FC<CreateProps> = () => {
|
2023-02-13 12:41:30 +00:00
|
|
|
const { data: session } = useSession();
|
|
|
|
|
return (
|
2023-06-07 12:14:12 +00:00
|
|
|
<Create title="Create Users">
|
2023-02-13 12:41:30 +00:00
|
|
|
<SimpleForm>
|
|
|
|
|
<TextInput source="email" />
|
|
|
|
|
<TextInput source="name" />
|
|
|
|
|
<UserRoleInput session={session} initialValue="NONE" />
|
|
|
|
|
<BooleanInput source="isActive" defaultValue={true} />
|
2023-03-14 17:40:24 +00:00
|
|
|
<TextInput source="createdBy" defaultValue={session?.user?.name} />
|
2023-02-13 12:41:30 +00:00
|
|
|
</SimpleForm>
|
|
|
|
|
</Create>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default UserCreate;
|