import React = require('react');
import { observer } from 'mobx-react';
import { Doc, Field } from '../../../../fields/Doc';
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>
        );
    }
}
