import React, { Fragment } from 'react'; import DataTitle from './data-title'; import InfoBox from '../../components/info-box'; import CheckboxDataEntry from '../data-components/checkbox-data-entry'; interface PlanningDataOfficialDataEntryProps { value: any; // TODO: proper structuring! } const {useState} = React; const LongText = ({ content,limit}) => { const [showAll, setShowAll] = useState(false); const showMore = () => setShowAll(true); const showLess = () => setShowAll(false); if (content.length <= limit) { return
{content}
} if (showAll) { return
{content}
Shorten description
} const toShow = content.substring(0, limit).trim() + "... "; return
{toShow}
Show full description
} const PlanningDataOfficialDataEntry: React.FC = (props) => { const data = props.value || []; if(data.length == 0) { return ( No live planning data available currently for this building polygon via the Planning London DataHub.
Disclaimer: data is imported from the official source, but Planning London DataHub is known to be incomplete.
); } return ( Current planning application status for this site: {data[0]["status"]}
Decision date: {data[0]["decision_date"].toString()}
Description of proposed work:
Planning application ID: {data[0]["planning_application_id"]}
Planning portal link: not provided
Most recent update by data provider: {data[0]["decision_date"]}
Disclaimer: data is imported from the official source, but Planning London DataHub is known to be incomplete.
); }; export default PlanningDataOfficialDataEntry;