import { Outlined } from 'client/Components/Spinner';
import { formatMoney } from 'core/tools/format';
import { InsTableColumn } from '../../../lib/config/table';

const columns: InsTableColumn[] = [
  {
    title: 'Страховая компания',
    dataIndex: 'name',
  },
  {
    title: 'Сумма',
    dataIndex: 'premiumSum',
    //@ts-ignore
    sorter: (a, b) => a.premiumSum || 0 - b.premiumSum || 0,
    sortDirections: ['descend', 'ascend'],
    render: value => formatMoney(value),
  },
  {
    title: undefined,
    dataIndex: 'isFetching',
    render: isFetching => (isFetching ? Outlined : null),
  },
];

export default columns;
