mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 22:14:11 +08:00
24 lines
628 B
JavaScript
24 lines
628 B
JavaScript
import React from 'react';
|
|
import {gql, compose} from 'react-apollo';
|
|
import {connect, excludeIf, withFragments} from 'plugin-api/beta/client/hocs';
|
|
import ModerationActions from '../components/ModerationActions';
|
|
import {can} from 'plugin-api/beta/client/services';
|
|
|
|
const mapStateToProps = ({auth}) => ({
|
|
user: auth.user
|
|
});
|
|
|
|
const enhance = compose(
|
|
connect(mapStateToProps),
|
|
withFragments({
|
|
comment: gql`
|
|
fragment TalkModerationActions_comment on Comment {
|
|
id
|
|
status
|
|
}
|
|
`}),
|
|
excludeIf((props) => !can(props.user, 'MODERATE_COMMENTS')),
|
|
);
|
|
|
|
export default enhance(ModerationActions);
|