/** @format */

import * as React from 'react';
import {Table, Row, Col} from 'antd';
import {TableProps} from 'antd/es/table';
import styles from './table.module.scss';
export default class extends React.Component<TableProps<any>> {
    render() {
        const {pagination, ...rest} = this.props;
        return (
            <Table
                className={styles['custom-table']}
                bordered
                scroll={{x: true, scrollToFirstRowOnChange: true}}
                pagination={pagination === false ? false : {hideOnSinglePage: true, ...pagination}}
                {...rest}
            />
        );
    }
}

interface ExpandedRowProps {
    left: React.ReactNode;
    right: React.ReactNode;
}
export const ExpandedRow: React.FC<ExpandedRowProps> = props => {
    const {left, right} = props;
    return (
        <Row gutter={12}>
            <Col span={10}>{left}</Col>
            <Col span={11}>{right}</Col>
        </Row>
    );
};
