aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2022-08-10 11:51:41 -0400
committermehekj <mehek.jethani@gmail.com>2022-08-10 11:51:41 -0400
commit19aa61f593c896f4d3bd0ffae6dbe306c2a9546d (patch)
tree5b016a606b6f6a258f8a476721ddbe0056320d59 /src/client/views/collections/collectionSchema/SchemaRowBox.tsx
parentfe5b49705069eebccec22e6cad29b007a60e3bec (diff)
basic table in progress
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaRowBox.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaRowBox.tsx33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaRowBox.tsx b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
new file mode 100644
index 000000000..50e2502dc
--- /dev/null
+++ b/src/client/views/collections/collectionSchema/SchemaRowBox.tsx
@@ -0,0 +1,33 @@
+import React = require('react');
+import { observer } from 'mobx-react';
+import './CollectionSchemaView.scss';
+import { ViewBoxAnnotatableComponent, ViewBoxBaseComponent } from '../../DocComponent';
+import { FieldViewProps } from '../../nodes/FieldView';
+import { SchemaTableCell } from './SchemaTableCell';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { undoBatch } from '../../../util/UndoManager';
+
+export interface SchemaRowBoxProps extends FieldViewProps {
+ columnKeys: string[];
+ columnWidths: number[];
+}
+
+@observer
+export class SchemaRowBox extends ViewBoxAnnotatableComponent<SchemaRowBoxProps>() {
+ render() {
+ return (
+ <div className="schema-row" /*style={this.props.isSelected() ? { backgroundColor: 'grey' } : {}}*/>
+ <div className="row-menu">
+ <div className="row-button" onPointerDown={undoBatch(() => this.props.removeDocument?.(this.props.Document))}>
+ <FontAwesomeIcon icon={'times'} />
+ </div>
+ </div>
+ <div className="row-cells">
+ {this.props.columnKeys.map((key, index) => (
+ <SchemaTableCell Document={this.props.Document} key={key} fieldKey={key} columnWidth={this.props.columnWidths[index]} />
+ ))}
+ </div>
+ </div>
+ );
+ }
+}