diff --git a/app/src/frontend/building/data-containers/size.tsx b/app/src/frontend/building/data-containers/size.tsx index 1ae07ab8..763b2a5a 100644 --- a/app/src/frontend/building/data-containers/size.tsx +++ b/app/src/frontend/building/data-containers/size.tsx @@ -15,441 +15,469 @@ import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-e /** * Size view/edit section */ -const SizeView: React.FunctionComponent = (props) => ( - - - - - - - - - - {(props.building.size_storeys_source_type == commonSourceTypes[0] || - props.building.size_storeys_source_type == commonSourceTypes[1] || - props.building.size_storeys_source_type == null) ? <> : - <> = (props) => { + + // Calculate the total number of floors + let total_floors = 0; + + if (props.building.size_storeys_attic != null) { + total_floors += props.building.size_storeys_attic; + } + if (props.building.size_storeys_core != null) { + total_floors += props.building.size_storeys_core; + } + if (props.building.size_storeys_basement != null) { + total_floors += props.building.size_storeys_basement; + } + + return ( + + + + + + + + + + - - } - - - - - - {(props.building.size_height_apex_source_type == commonSourceTypes[0] || - props.building.size_height_apex_source_type == commonSourceTypes[1] || - props.building.size_height_apex_source_type == null) ? <> : - <> : + <> + + } + + + - - } -
- - - - {(props.building.size_height_eaves_source_type == commonSourceTypes[0] || - props.building.size_height_eaves_source_type == commonSourceTypes[1] || - props.building.size_height_eaves_source_type == null) ? <> : - <> + - - } -
- - - - - - - {(props.building.size_floor_area_source_type == commonSourceTypes[0] || - props.building.size_floor_area_source_type == commonSourceTypes[1] || - props.building.size_floor_area_source_type == null) ? <> : - <> : + <> + + } +
+ - - } -
- - - - - {(props.building.size_width_frontage_source_type == commonSourceTypes[0] || - props.building.size_width_frontage_source_type == commonSourceTypes[1] || - props.building.size_width_frontage_source_type == null) ? <> : - <> + - - } -
- - - - {(props.building.size_plot_area_total_source_type == commonSourceTypes[0] || - props.building.size_plot_area_total_source_type == commonSourceTypes[1] || - props.building.size_far_ratio_source_type == null) ? <> : - <> : + <> + + } +
+ + - - } -
- - - - {(props.building.size_far_ratio_source_type == commonSourceTypes[0] || - props.building.size_far_ratio_source_type == commonSourceTypes[1] || - props.building.size_far_ratio_source_type == null) ? <> : - <> + - - } -
- - - - {(props.building.size_parcel_geometry_source_type == commonSourceTypes[0] || - props.building.size_parcel_geometry_source_type == commonSourceTypes[1] || - props.building.size_parcel_geometry_source_type == null) ? <> : - <> + + {(props.building.size_floor_area_source_type == commonSourceTypes[0] || + props.building.size_floor_area_source_type == commonSourceTypes[1] || + props.building.size_floor_area_source_type == null) ? <> : + <> + + } +
+ + + + + {(props.building.size_width_frontage_source_type == commonSourceTypes[0] || + props.building.size_width_frontage_source_type == commonSourceTypes[1] || + props.building.size_width_frontage_source_type == null) ? <> : + <> + + } +
+ + + + {(props.building.size_plot_area_total_source_type == commonSourceTypes[0] || + props.building.size_plot_area_total_source_type == commonSourceTypes[1] || + props.building.size_far_ratio_source_type == null) ? <> : + <> + + } +
+ + + + {(props.building.size_far_ratio_source_type == commonSourceTypes[0] || + props.building.size_far_ratio_source_type == commonSourceTypes[1] || + props.building.size_far_ratio_source_type == null) ? <> : + <> + + } +
+ - - } -
-
-); + + + {(props.building.size_parcel_geometry_source_type == commonSourceTypes[0] || + props.building.size_parcel_geometry_source_type == commonSourceTypes[1] || + props.building.size_parcel_geometry_source_type == null) ? <> : + <> + + } +
+
+ ) +}; const SizeContainer = withCopyEdit(SizeView); export default SizeContainer;