import React, { Component } from 'react';
import { config } from './base/config';
import s from './Column.less';
import { ColumnProps } from './interface';

export default class TableColumn extends Component<ColumnProps> {
    constructor(props: ColumnProps) {
        super(props);
    }

    render() {
        let { type, title, width=200 } = this.props;
        let icon = config[String(type)] && config[String(type)].icon;
        return (
            <div className={s.colContainer} style={{ width: width }}>
                <div className={s.colBrief}>
                    <img className={s.colIcon} src={icon} />
                    <span className={s.colTitle}>{title}</span>
                </div>
            </div>
        );
    }
}
