diff --git a/packages/semantic-ui/src/components/DataTable.js b/packages/semantic-ui/src/components/DataTable.js index 03967046..cea9169b 100644 --- a/packages/semantic-ui/src/components/DataTable.js +++ b/packages/semantic-ui/src/components/DataTable.js @@ -14,11 +14,9 @@ import _ from 'underscore'; import i18n from '../i18n/i18n'; import ColumnResize from './ColumnResize'; import useColumnSelector, { type Props as ColumnSelectorProps } from './DataTableColumnSelector'; -import useList, { type Props as ListProps } from './List'; +import useList, { type Action, type Props as ListProps } from './List'; import './DataTable.css'; -import type { Action } from './List'; - type Props = ListProps & ColumnSelectorProps & { /** * If true, the rows of the table can be expanded and collapsed. @@ -352,36 +350,7 @@ class DataTable extends Component { return null; } - const actions = this.props.actions - .filter((action) => !action.accept || action.accept(item)) - .map((action) => { - let defaults = {}; - - if (action.name === 'edit') { - defaults = { - popup: { - title: i18n.t('DataTable.actions.edit.title'), - content: i18n.t('DataTable.actions.edit.content') - } - }; - } else if (action.name === 'copy') { - defaults = { - popup: { - title: i18n.t('DataTable.actions.copy.title'), - content: i18n.t('DataTable.actions.copy.content') - } - }; - } else if (action.name === 'delete') { - defaults = { - popup: { - title: i18n.t('DataTable.actions.delete.title'), - content: i18n.t('DataTable.actions.delete.content') - } - }; - } - - return _.defaults(action, defaults); - }); + const actions = this.props.actions.filter((action) => !action.accept || action.accept(item)); return ( { extra textAlign='center' > - { _.map(actions, (action, actionIndex) => ( -