{"size": 1136, "ext": "js", "max_stars_repo_path": "reactadmin/src/people.js", "max_stars_repo_name": "yvesago/react-admin-e2ee", "max_stars_repo_stars_event_min_datetime": "2018-09-12T16:35:37.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-22T06:40:36.000Z", "max_issues_repo_path": "reactadmin/src/people.js", "max_issues_repo_name": "yvesago/react-admin-e2ee", "max_issues_repo_issues_event_min_datetime": "2021-02-08T07:51:05.000Z", "max_issues_repo_issues_event_max_datetime": "2021-02-08T07:51:05.000Z", "max_forks_repo_path": "reactadmin/src/people.js", "max_forks_repo_name": "yvesago/react-admin-e2ee", "max_forks_repo_forks_event_min_datetime": "2019-09-30T10:28:52.000Z", "max_forks_repo_forks_event_max_datetime": "2019-09-30T10:28:52.000Z"}
{"max_stars_count": 4, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 28.4, "max_line_length": 66, "alphanum_fraction": 0.5589788732}
import React from 'react';
import { List, Edit, Create, Datagrid, TextField, EditButton,
    DisabledInput, LongTextInput, DateInput,
    SimpleForm, TextInput } from 'react-admin';
import { VaultActions } from './VaultActions';

export const PeopleList = (props) => (
    <List actions={<VaultActions />} {...props}>
        <Datagrid>
            <TextField source="id" />
            <TextField source="name" />
            <EditButton />
        </Datagrid>
    </List>
);

const PeopleTitle = ({ record }) => {
    return <span>People {record ? `"${record.name}"` : ''}</span>;
};

export const PeopleEdit = (props) => (
    <Edit title={<PeopleTitle />} {...props}>
        <SimpleForm>
            <DisabledInput source="id" />
            <TextInput source="name" />
            <LongTextInput source="xaddress" />
            <DateInput label="Date of birth" source="xdob" />
        </SimpleForm>
    </Edit>
);

export const PeopleCreate = (props) => (
    <Create {...props}>
        <SimpleForm>
            <TextInput source="name" />
            <LongTextInput source="xaddress" />
        </SimpleForm>
    </Create>
);
