/** * @file * @copyright 2020 Aleksej Komarov * @license MIT */ import { useDispatch, useSelector } from 'tgui/backend'; import { Button, Collapsible, Divider, Input, Section, Stack, } from 'tgui/components'; import { moveChatPageLeft, moveChatPageRight, removeChatPage, toggleAcceptedType, updateChatPage, } from './actions'; import { MESSAGE_TYPES } from './constants'; import { selectCurrentChatPage } from './selectors'; export const ChatPageSettings = (props) => { const page = useSelector(selectCurrentChatPage); const dispatch = useDispatch(); return (
dispatch( updateChatPage({ pageId: page.id, name: value, }), ) } /> dispatch( updateChatPage({ pageId: page.id, hideUnreadCount: !page.hideUnreadCount, }), ) } /> {!page.isMain ? ( ) : ( '' )} {!page.isMain ? ( Reorder Chat:  ) : ( '' )}
{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} ))}
); };