mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
27 lines
783 B
TypeScript
27 lines
783 B
TypeScript
import React, { FC } from 'react';
|
|
import { CommentWrapper } from '~/components/containers/CommentWrapper';
|
|
import { connect } from 'react-redux';
|
|
import { selectAuthUser } from '~/redux/auth/selectors';
|
|
import { CommentForm } from '~/components/comment/CommentForm';
|
|
import { INode } from '~/redux/types';
|
|
|
|
const mapStateToProps = state => ({
|
|
user: selectAuthUser(state),
|
|
});
|
|
|
|
type IProps = ReturnType<typeof mapStateToProps> & {
|
|
isBefore?: boolean;
|
|
nodeId: INode['id'];
|
|
};
|
|
|
|
const NodeCommentFormUnconnected: FC<IProps> = ({ user, isBefore, nodeId }) => {
|
|
return (
|
|
<CommentWrapper user={user}>
|
|
<CommentForm nodeId={nodeId} />
|
|
</CommentWrapper>
|
|
);
|
|
};
|
|
|
|
const NodeCommentForm = connect(mapStateToProps)(NodeCommentFormUnconnected);
|
|
|
|
export { NodeCommentForm };
|