import React, { Fragment } from 'react'; import { Link, NavLink } from 'react-router-dom'; import queryString from 'query-string'; import Sidebar from './sidebar'; import Tooltip from './tooltip'; import InfoBox from './info-box'; import { HelpIcon, EditIcon } from './icons'; import CONFIG from './fields-config.json'; const BuildingView = (props) => { if (!props.building_id){ return (
Back to maps
); } const search = (props.location && props.location.search)? queryString.parse(props.location.search): {}; return ( { CONFIG.map(section_props => ( { section_props.fields.map(field_props => ( )) } )) } ); } const DataSection = (props) => { const match = props.search.cat === props.slug; return (
match}>

{props.title}

{ match?
{props.children}
: null } { (match && !props.inactive)?
Edit data
: null }
); } const DataEntry = (props) => (
{ props.title } { props.tooltip? : null }
{props.value ? props.value : '\u00A0'}
); export default BuildingView;