import React from 'react' import { CCard, CCardBody, CCardHeader, CCol, CRow } from '@coreui/react-ts' import CIcon from '@coreui/icons-react' import usersData from './UsersData' const User = ({match}) => { const user = usersData.find( user => user.id.toString() === match.params.id) const userDetails = user ? Object.entries(user) : [['id', ( Not found)]] return ( User id: {match.params.id} { userDetails.map(([key, value], index) => { return ( ) }) }
{`${key}:`} {value}
) } export default User