import {
  TStorageCardInfoField,
  TUseStorageColumns,
  TypeCardInfoTranslations,
  TypeColumnsTranslations,
} from './types';

export const useStorageColumns = ({
  format,
  size,
  description,
  created,
  actions,
}: TypeColumnsTranslations): TUseStorageColumns[] => [
  {
    title: format,
    dataIndex: 'format',
    key: 'format',
    align: 'center',
    sortOrder: false,
    sorter: {
      multiple: 1,
    },
  },
  {
    title: size,
    dataIndex: 'size',
    key: 'size',
    align: 'center',
    sortOrder: false,
    sorter: {
      multiple: 2,
    },
  },
  {
    title: description,
    dataIndex: 'description',
    key: 'description',
    align: 'center',
    sortOrder: false,
    sorter: {
      multiple: 3,
    },
  },
  {
    title: created,
    dataIndex: 'created',
    key: 'created',
    align: 'center',
    sortOrder: false,
    sorter: {
      multiple: 4,
    },
  },
  {
    title: actions,
    dataIndex: 'actions',
    key: 'actions',
    align: 'center',
  },
];
export const useStorageCardInfoFields = ({
  description,
  size,
  created,
  format,
  crc,
}: TypeCardInfoTranslations): TStorageCardInfoField[] => [
  {
    title: description,
    dataIndex: 'description',
    key: 'description',
    align: 'center',
  },
  {
    title: size,
    dataIndex: 'size',
    key: 'size',
    align: 'center',
  },
  {
    title: created,
    dataIndex: 'created',
    key: 'created',
    align: 'center',
  },
  {
    title: format,
    dataIndex: 'format',
    key: 'format',
    align: 'center',
  },
  {
    title: crc,
    dataIndex: 'crc',
    key: 'crc',
    align: 'center',
  },
];
