update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b third try
[osm/UI.git] / skyquake / plugins / admin / src / components / ExplorerColumn.jsx
1 import React from 'react'
2 import ActionBar from './ActionBar'
3
4 export default ({ title, children, columnCloser, isLast, actions, handler }) => {
5     let actionBar = null;
6     if (isLast) {
7         if (columnCloser) {
8             actions = actions ? actions.slice() : [];
9             actions.push('close');
10         }
11         actionBar = (<ActionBar actions={actions} handler={(operation) => operation === 'close' ? columnCloser() : handler(operation)} />);
12     } else {
13         actionBar = (<ActionBar />);
14     }
15     return (
16         <div className='column' style={{ backgroundColor: 'gainsboro', height: '100%', display: 'flex', flexDirection: 'column', marginLeft: '4px', marginRight: '4px' }} >
17             <h2 style={{ marginBottom: '4px' }} >{title}</h2>
18             {actionBar}
19             {children}
20         </div>
21     )
22 }
23