import React, { Fragment } from 'react'; import DataTitle from './data-title'; interface UPRNsDataEntryProps { title: string; tooltip: string; value: { uprn: string; parent_uprn?: string; }[]; } const UPRNsDataEntry: React.FC = (props) => { const uprns = props.value || []; const noParent = uprns.filter(uprn => uprn.parent_uprn == null); const withParent = uprns.filter(uprn => uprn.parent_uprn != null); return (
{ noParent.length?
    { noParent.map(uprn => (
  • {uprn.uprn}
  • )) }
: '\u00A0' } { withParent.length?
Children
    { withParent.map(uprn => (
  • {uprn.uprn} (child of {uprn.parent_uprn})
  • )) }
: null }
); }; export default UPRNsDataEntry;