2019-08-14 17:10:25 -04:00
import React , { Fragment } from 'react' ;
2019-08-14 14:33:26 -04:00
2019-08-14 16:54:00 -04:00
import withCopyEdit from '../data-container' ;
import DataEntry from '../data-components/data-entry' ;
2019-10-02 08:32:00 -04:00
import SelectDataEntry from '../data-components/select-data-entry' ;
import NumericDataEntry from '../data-components/numeric-data-entry' ;
2019-08-14 14:33:26 -04:00
2019-10-02 08:32:00 -04:00
const EnergyCategoryOptions = [ "A" , "B" , "C" , "D" , "E" , "F" , "G" ] ;
const BreeamRatingOptions = [
'Outstanding' ,
'Excellent' ,
'Very good' ,
'Good' ,
'Pass' ,
'Unclassified'
] ;
2019-08-14 14:33:26 -04:00
/ * *
* Sustainability view / edit section
* /
2019-10-02 08:32:00 -04:00
const SustainabilityView = ( props ) = > {
return (
< Fragment >
< SelectDataEntry
title = "BREEAM Rating"
slug = "sust_breeam_rating"
value = { props . building . sust_breeam_rating }
tooltip = "(Building Research Establishment Environmental Assessment Method) May not be present for many buildings"
options = { BreeamRatingOptions }
2019-10-16 16:13:50 -04:00
mode = { props . mode }
copy = { props . copy }
2019-10-17 10:32:41 -04:00
onChange = { props . onUpdate }
2019-10-02 08:32:00 -04:00
/ >
< SelectDataEntry
title = "DEC Rating"
slug = "sust_dec"
value = { props . building . sust_dec }
tooltip = "(Display Energy Certificate) Any public building should have (and display) a DEC. Showing how the energy use for that building compares to other buildings with same use"
options = { EnergyCategoryOptions }
2019-10-16 16:13:50 -04:00
mode = { props . mode }
copy = { props . copy }
2019-10-17 10:32:41 -04:00
onChange = { props . onUpdate }
2019-10-02 08:32:00 -04:00
/ >
< SelectDataEntry
title = "EPC Rating"
slug = "sust_aggregate_estimate_epc"
value = { props . building . sust_aggregate_estimate_epc }
tooltip = "(Energy Performance Certifcate) Any premises sold or rented is required to have an EPC to show how energy efficient it is. Only buildings rate grade E or higher maybe rented"
options = { EnergyCategoryOptions }
disabled = { true }
2019-10-16 16:13:50 -04:00
mode = { props . mode }
copy = { props . copy }
2019-10-17 10:32:41 -04:00
onChange = { props . onUpdate }
2019-10-02 08:32:00 -04:00
/ >
< NumericDataEntry
title = "Last significant retrofit"
slug = "sust_retrofit_date"
value = { props . building . sust_retrofit_date }
tooltip = "Date of last major building refurbishment"
step = { 1 }
min = { 1086 }
max = { new Date ( ) . getFullYear ( ) }
2019-10-16 16:13:50 -04:00
mode = { props . mode }
copy = { props . copy }
onChange = { props . onUpdate }
2019-10-02 08:32:00 -04:00
/ >
< NumericDataEntry
title = "Expected lifespan for typology"
slug = "sust_life_expectancy"
value = { props . building . sust_life_expectancy }
step = { 1 }
min = { 1 }
disabled = { true }
2019-10-16 16:13:50 -04:00
mode = { props . mode }
copy = { props . copy }
onChange = { props . onUpdate }
2019-10-02 08:32:00 -04:00
/ >
< / Fragment >
) ;
}
2019-08-14 14:33:26 -04:00
const SustainabilityContainer = withCopyEdit ( SustainabilityView ) ;
export default SustainabilityContainer ;