import React from 'react'; import tw from 'twin.macro'; import AdminContentBlock from '@/components/admin/AdminContentBlock'; import FlashMessageRender from '@/components/FlashMessageRender'; import UserForm from '@/components/admin/users/UserForm'; import { useHistory } from 'react-router-dom'; import { Actions, useStoreActions } from 'easy-peasy'; import { ApplicationStore } from '@/state'; import { FormikHelpers } from 'formik'; import { createUser, UpdateUserValues } from '@/api/admin/users'; export default () => { const history = useHistory(); const { clearFlashes, clearAndAddHttpError } = useStoreActions((actions: Actions) => actions.flashes); const submit = (values: UpdateUserValues, { setSubmitting }: FormikHelpers) => { clearFlashes('user:create'); createUser(values) .then(user => history.push(`/admin/users/${user.id}`)) .catch(error => { console.error(error); clearAndAddHttpError({ key: 'user:create', error }); }) .then(() => setSubmitting(false)); }; return (

New User

Add a new user to the panel.

); };