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 Disclaimer = () => { return Disclaimer: Planning application status is visualised using data uploaded by local authorities to the
Greater London Authority's Planning London DataHub. Please note that these data are currently incomplete and also often do not provide information on minor alterations. For comprehensive information on all applications please visit the UK Planning Portal site.
}
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.
);
}
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"]}
);
};
export default PlanningDataOfficialDataEntry;