import React from 'react'; import { Link } from 'react-router-dom'; import InfoBox from '../../../components/info-box'; import { Category } from '../../../config/categories-config'; import { dataFields } from '../../../config/data-fields-config'; import DataEntry from '../../data-components/data-entry'; import { DataEntryGroup } from '../../data-components/data-entry-group'; import { DynamicsBuildingPane, DynamicsDataEntry } from './dynamics-data-entry'; import { FieldRow } from '../../data-components/field-row'; import NumericDataEntry from '../../data-components/numeric-data-entry'; import withCopyEdit from '../../data-container'; import { CategoryViewProps } from '../category-view-props'; import { LogicalDataEntry } from '../../data-components/logical-data-entry/logical-data-entry'; /** * Dynamics view/edit section */ const DynamicsView: React.FunctionComponent = (props) => { const building = props.building; const thisYear = (new Date()).getFullYear(); const currentBuildingConstructionYear = building.date_year || undefined; const ageLinkUrl = `/${props.mode}/${Category.Age}/${props.building.building_id}`; return (<>
{ currentBuildingConstructionYear == undefined ? To add historical records, fill in the Age data first. : <> 0} disallowNull={(building.demolished_buildings?.length ?? 0) > 0} onChange={props.onSaveChange} mode={props.mode} copy={props.copy} /> { building.dynamics_has_demolished_buildings && <> { props.mode === 'view' && Switch to edit mode to add/edit past building records } } }
This section is under development in collaboration with the historic environment sector. Please let us know your suggestions on the discussion forum! (external link - save your edits first) ) }; const DynamicsContainer = withCopyEdit(DynamicsView); export default DynamicsContainer;