29 lines
1,016 B
TypeScript
29 lines
1,016 B
TypeScript
// * Other
|
|
import { Actions, Methods } from "@/lib/enums";
|
|
import { SingleResource, UserModel } from "@/back/types/global";
|
|
import trans from "@/hooks/use-translations";
|
|
import AuthenticatedLayout from "@/back/Layouts/AuthenticatedLayout";
|
|
import Form from "@/back/Pages/Users/Form";
|
|
|
|
export default function Create({ data }: { data: SingleResource }) {
|
|
const userModel = data.data as UserModel;
|
|
return (
|
|
<AuthenticatedLayout
|
|
title={trans(
|
|
route().current(`back.users.duplicate`)
|
|
? "crud.helpers.duplication_model"
|
|
: "crud.helpers.creation_model",
|
|
{ model: trans("models.classes.user") }
|
|
)}
|
|
linkBefore={route("back.users.index")}
|
|
>
|
|
<Form
|
|
model={userModel}
|
|
modelName="user"
|
|
modelRoute="users"
|
|
action={Actions.STORE}
|
|
method={Methods.POST}
|
|
/>
|
|
</AuthenticatedLayout>
|
|
);
|
|
}
|