Reports: import statuses, add getReport selector

This commit is contained in:
Alex Gleason
2020-12-31 20:11:08 -06:00
parent 90414939a5
commit a8893907d4
4 changed files with 22 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import Column from '../ui/components/column';
import ScrollableList from 'soapbox/components/scrollable_list';
import { fetchReports } from 'soapbox/actions/admin';
import Report from './components/report';
import { makeGetReport } from 'soapbox/selectors';
const messages = defineMessages({
heading: { id: 'column.admin.reports', defaultMessage: 'Reports' },
@@ -15,9 +16,11 @@ const messages = defineMessages({
});
const mapStateToProps = state => {
const getReport = makeGetReport();
const ids = state.getIn(['admin', 'openReports']);
return {
reports: ids.toList().map(id => state.getIn(['admin', 'reports', id])),
reports: ids.map(id => getReport(state, id)),
};
};