import React from 'react';
import ReactDOM from 'react-dom';
import { DataTable } from 'react-data-components';
function buildTable(data) {
const renderMapUrl =
(val, row) =>
Google Maps
;
const tableColumns = [
{ title: 'Name', prop: 'name' },
{ title: 'City', prop: 'city' },
{ title: 'Street address', prop: 'street' },
{ title: 'Phone', prop: 'phone', defaultContent: '' },
{ title: 'Map', render: renderMapUrl, className: 'text-center' },
];
return (
);
}
fetch('/data.json')
.then(res => res.json())
.then((rows) => {
ReactDOM.render(buildTable(rows), document.getElementById('root'));
});