aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
blob: 1eb5e0e011608e1d9a56636ab00f6f1d383b3a57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React = require('react');
import { observer } from 'mobx-react';
import { Doc, Field } from '../../../../fields/Doc';
import { StrCast } from '../../../../fields/Types';
import './CollectionSchemaView.scss';

export interface SchemaTableCellProps {
    Document: Doc;
    fieldKey: string;
    columnWidth: number;
}

@observer
export class SchemaTableCell extends React.Component<SchemaTableCellProps> {
    render() {
        return (
            <div className="schema-table-cell" style={{ width: this.props.columnWidth }}>
                {/* {StrCast(this.props.Document[this.props.fieldKey])} */}
                {/* Field.toKeyValueString(this.props.Document, this.props.fieldKey) */}
                {Field.toString(this.props.Document[this.props.fieldKey] as Field)}
            </div>
        );
    }
}