/** * @file * @copyright 2020 Aleksej Komarov * @license MIT */ import { useDispatch, useSelector } from 'common/redux'; import { Button, Collapsible, Divider, Input, Section, Stack } from 'tgui_ch/components'; // CHOMPEdit - tgui_ch import { removeChatPage, toggleAcceptedType, updateChatPage } from './actions'; import { MESSAGE_TYPES } from './constants'; import { selectCurrentChatPage } from './selectors'; export const ChatPageSettings = (props, context) => { const page = useSelector(context, selectCurrentChatPage); const dispatch = useDispatch(context); return (
dispatch( updateChatPage({ pageId: page.id, name: value, }) ) } />
{MESSAGE_TYPES.filter( (typeDef) => !typeDef.important && !typeDef.admin ).map((typeDef) => ( dispatch( toggleAcceptedType({ pageId: page.id, type: typeDef.type, }) ) }> {typeDef.name} ))} {MESSAGE_TYPES.filter( (typeDef) => !typeDef.important && typeDef.admin ).map((typeDef) => ( dispatch( toggleAcceptedType({ pageId: page.id, type: typeDef.type, }) ) }> {typeDef.name} ))}
); };