import * as React from "react";import {Button,Typography,Box} from '@mui/material';import { Edit, ListButton,useRecordContext, ShowButton, SimpleForm, TextInput,TopToolbar, DateInput, ReferenceManyField, Datagrid, TextField, DateField, Edit
import * as React from "react";
import {Button,Typography,Box} from '@mui/material';
import { Edit, ListButton,useRecordContext, ShowButton, SimpleForm, TextInput,TopToolbar, DateInput, ReferenceManyField, Datagrid, TextField, DateField, EditButton, required } from 'react-admin';
const PostTitle = () => {
const record = useRecordContext();
return <span>Post {record ? `"${record.name}"` : '1111'}</span>;
};
export const SimpleFormEdit = () => {
const PostEditActions = () => (
<TopToolbar>
<ShowButton />
{/* Add your custom actions */}
<ListButton />
<Button color="primary" >Custom Action</Button>
</TopToolbar>
);
const Aside = () => (
<Box sx={{ width: '200px', margin: '1em' }}>
<Typography variant="h6">Instructions</Typography>
<Typography variant="body2">
Posts will only be published once an editor approves them
</Typography>
</Box>
);
return(
<Edit >
<SimpleForm warnWhenUnsavedChanges>
<TextInput source="name" validate={[required()]} fullWidth />
<TextInput source="sex" multiline={true} label="Short description" />
<TextInput source="salary" multiline={true} label="Short description" />
</SimpleForm>
</Edit>
)
}