Edit and actions updates
This commit is contained in:
parent
0997e449bb
commit
f87bcc43a5
30 changed files with 759 additions and 139 deletions
|
|
@ -1,15 +1,13 @@
|
|||
"use client";
|
||||
|
||||
import { FC, useEffect } from "react";
|
||||
import { FC } from "react";
|
||||
import { useFormState } from "react-dom";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Grid } from "@mui/material";
|
||||
import { TextField } from "ui";
|
||||
import { Create as InternalCreate } from "@/app/_components/Create";
|
||||
import { addFacebookBotAction } from "../../_actions/facebook";
|
||||
|
||||
export const Create: FC = () => {
|
||||
const router = useRouter();
|
||||
const initialState = {
|
||||
message: null,
|
||||
errors: {},
|
||||
|
|
@ -24,17 +22,12 @@ export const Create: FC = () => {
|
|||
initialState,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (formState.success) {
|
||||
router.back();
|
||||
}
|
||||
}, [formState.success, router]);
|
||||
|
||||
return (
|
||||
<InternalCreate
|
||||
title="Create Facebook Bot"
|
||||
title="Create Facebook Connection"
|
||||
entity="facebook"
|
||||
formAction={formAction}
|
||||
formState={formState}
|
||||
>
|
||||
<Grid container direction="row" rowSpacing={3} columnSpacing={2}>
|
||||
<Grid item xs={12}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue