mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-30 12:24:27 +01:00
34 lines
811 B
JavaScript
34 lines
811 B
JavaScript
import React from 'react';
|
|
import Section from "./section";
|
|
|
|
export default class ShellExplorer extends React.PureComponent {
|
|
|
|
render() {
|
|
let {shell} = this.props;
|
|
|
|
let faceControls = <span>
|
|
<i className='fa fa-fw fa-eye' onClick={alert}/>
|
|
<i className='fa fa-fw fa-eye-slash' onClick={alert}/>
|
|
</span>;
|
|
|
|
return <div className='shell-explorer'>
|
|
|
|
<Section name='faces' closable>
|
|
{shell.faces.map(face => <Section name={`face ${face.refId}`} tabs='0.5em' closable defaultClosed={true} controls={faceControls}>
|
|
{mapIterator(face.edges, e => <div>
|
|
edge: {e.refId}
|
|
</div>)}
|
|
</Section>)
|
|
}
|
|
</Section>
|
|
</div>;
|
|
}
|
|
}
|
|
|
|
function mapIterator(it, fn) {
|
|
for (let i of it) {
|
|
fn(i);
|
|
}
|
|
}
|
|
|
|
|