import React from 'react' import { Helmet } from 'react-helmet' import { Link } from 'react-router-dom' export default function AdminPage(props) { const { data, detailLink, target } = props const { error } = data const results = data.data const tbKeys = [] if (results.length > 0) { Object.keys(results[0]).map(key => tbKeys.push(key)) } const title = target.charAt(0).toUpperCase() + target.slice(1) return (
mpwo - Admin

Administration - {title}

{error ? ( {error} ) : (
{tbKeys.map( tbKey => )} { results.map((result, idx) => ( { Object.keys(result).map(key => { if (key === 'id') { return ( ) } return }) } ))}
{tbKey}
{result[key]} {result[key]}
)}
) }