2019-08-14 17:23:12 -04:00
|
|
|
import React, { Fragment } from 'react';
|
2019-08-14 14:33:26 -04:00
|
|
|
|
2019-12-03 13:17:04 -05:00
|
|
|
import InfoBox from '../../components/info-box';
|
|
|
|
import { dataFields } from '../../data_fields';
|
|
|
|
import DataEntry from '../data-components/data-entry';
|
2020-01-09 14:43:59 -05:00
|
|
|
import MultiDataEntry from '../data-components/multi-data-entry/multi-data-entry';
|
2019-08-14 16:54:00 -04:00
|
|
|
import withCopyEdit from '../data-container';
|
2019-11-07 02:39:26 -05:00
|
|
|
|
2019-10-18 10:06:50 -04:00
|
|
|
import { CategoryViewProps } from './category-view-props';
|
2019-08-14 14:33:26 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use view/edit section
|
|
|
|
*/
|
2019-10-18 10:06:50 -04:00
|
|
|
const UseView: React.FunctionComponent<CategoryViewProps> = (props) => (
|
2019-08-14 17:23:12 -04:00
|
|
|
<Fragment>
|
2019-12-03 13:17:04 -05:00
|
|
|
<MultiDataEntry
|
|
|
|
title={dataFields.current_landuse_group.title}
|
2020-03-23 19:33:03 -04:00
|
|
|
tooltip={dataFields.current_landuse_group.tooltip}
|
2019-12-03 13:17:04 -05:00
|
|
|
slug="current_landuse_group"
|
|
|
|
value={props.building.current_landuse_group}
|
2020-01-06 14:48:47 -05:00
|
|
|
mode={props.mode}
|
2019-12-03 13:17:04 -05:00
|
|
|
copy={props.copy}
|
|
|
|
onChange={props.onChange}
|
|
|
|
// tooltip={dataFields.current_landuse_class.tooltip}
|
|
|
|
placeholder="New land use group..."
|
2020-03-19 14:17:56 -04:00
|
|
|
autofill={true}
|
|
|
|
showAllOptionsOnEmpty={true}
|
2019-12-03 13:17:04 -05:00
|
|
|
/>
|
|
|
|
<DataEntry
|
|
|
|
title={dataFields.current_landuse_order.title}
|
2020-03-23 19:33:03 -04:00
|
|
|
tooltip={dataFields.current_landuse_order.tooltip}
|
2019-12-03 13:17:04 -05:00
|
|
|
slug="current_landuse_order"
|
|
|
|
value={props.building.current_landuse_order}
|
2020-01-06 14:48:47 -05:00
|
|
|
mode={props.mode}
|
|
|
|
disabled={true}
|
2019-12-03 13:17:04 -05:00
|
|
|
copy={props.copy}
|
|
|
|
onChange={props.onChange}
|
|
|
|
/>
|
2020-03-19 10:41:44 -04:00
|
|
|
{
|
|
|
|
props.mode != 'view' &&
|
|
|
|
<InfoBox msg="Land use order is automatically derived from the land use groups"></InfoBox>
|
|
|
|
}
|
2019-08-14 17:23:12 -04:00
|
|
|
</Fragment>
|
2019-11-07 03:13:30 -05:00
|
|
|
);
|
2019-08-14 14:33:26 -04:00
|
|
|
const UseContainer = withCopyEdit(UseView);
|
|
|
|
|
|
|
|
export default UseContainer;
|