Unwrap ResourcePropertiesForm
[arvados-workbench2.git] / src / views-components / resource-properties-form / resource-properties-form.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { InjectedFormProps, reduxForm } from 'redux-form';
7 import { Grid, Button } from '@material-ui/core';
8 import { PropertyKeyField, PROPERTY_KEY_FIELD_NAME } from './property-key-field';
9 import { PropertyValueField, PROPERTY_VALUE_FIELD_NAME } from './property-value-field';
10
11 export interface ResourcePropertiesFormData {
12     [PROPERTY_KEY_FIELD_NAME]: string;
13     [PROPERTY_VALUE_FIELD_NAME]: string;
14 }
15
16 export const ResourcePropertiesForm = ({ handleSubmit }: InjectedFormProps<ResourcePropertiesFormData>) =>
17     <form onSubmit={handleSubmit}>
18         <Grid container spacing={16}>
19             <Grid item xs>
20                 <PropertyKeyField />
21             </Grid>
22             <Grid item xs>
23                 <PropertyValueField />
24             </Grid>
25             <Grid item xs>
26                 <Button variant='contained' type='submit'>Add</Button>
27             </Grid>
28         </Grid>
29     </form>;