import Switch from '#/components/Switch'
import dayjs from '#/plugins/dayjs'

export default (event: { [key: string]: any }): TableColumn[] => [
  // { type: 'selection', fixed: 'left' },

  {
    label: '单词',
    prop: 'wordSpell',
  },

  {
    label: '使用管理',
    width: 180,
    render: (h, scope) => {
      return (
        <Switch
          active-value={0}
          before-change={() => event.updateState(scope.row)}
          inactive-value={1}
          loading={scope.row.loading}
          v-model={scope.row.status}
        />
      )
    },
  },
  {
    label: '导入时间',
    prop: 'createTime',
    'show-overflow-tooltip': true,
    render: (h, scope) => {
      return dayjs(scope.row.createTime).format('YYYY/MM/DD HH:mm')
    },
  },
]
