19 lines
469 B
JavaScript
19 lines
469 B
JavaScript
function AttrList({list, title, onChange, children}) {
|
|
if (!list)
|
|
return null;
|
|
|
|
if (!list || !list.map || typeof list.map != 'function')
|
|
return <section className="page-contents">
|
|
<h4>{title}</h4>
|
|
value is not a list: {JSON.stringify(list)}
|
|
</section>;
|
|
|
|
return <section className="page-contents">
|
|
<h4>{title}</h4>
|
|
<ul>
|
|
{list.map((objectNum) => <li key={objectNum}>{JSON.stringify(objectNum)}</li>)}
|
|
</ul>
|
|
</section>
|
|
}
|
|
|
|
export default AttrList; |