update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b third try
[osm/UI.git] / skyquake / plugins / admin / src / components / ExplorerColumn.jsx
diff --git a/skyquake/plugins/admin/src/components/ExplorerColumn.jsx b/skyquake/plugins/admin/src/components/ExplorerColumn.jsx
new file mode 100644 (file)
index 0000000..20232a6
--- /dev/null
@@ -0,0 +1,23 @@
+import React from 'react'
+import ActionBar from './ActionBar'
+
+export default ({ title, children, columnCloser, isLast, actions, handler }) => {
+    let actionBar = null;
+    if (isLast) {
+        if (columnCloser) {
+            actions = actions ? actions.slice() : [];
+            actions.push('close');
+        }
+        actionBar = (<ActionBar actions={actions} handler={(operation) => operation === 'close' ? columnCloser() : handler(operation)} />);
+    } else {
+        actionBar = (<ActionBar />);
+    }
+    return (
+        <div className='column' style={{ backgroundColor: 'gainsboro', height: '100%', display: 'flex', flexDirection: 'column', marginLeft: '4px', marginRight: '4px' }} >
+            <h2 style={{ marginBottom: '4px' }} >{title}</h2>
+            {actionBar}
+            {children}
+        </div>
+    )
+}
+