/** * @file * @copyright 2020 Aleksej Komarov * @license MIT */ import { useDispatch, useSelector } from 'common/redux'; import { Box, Tabs, Flex, Button } from 'tgui/components'; import { changeChatPage, addChatPage } from './actions'; import { selectChatPages, selectCurrentChatPage } from './selectors'; import { openChatSettings } from '../settings/actions'; const UnreadCountWidget = ({ value }) => ( {Math.min(value, 99)} ); export const ChatTabs = (props, context) => { const pages = useSelector(context, selectChatPages); const currentPage = useSelector(context, selectCurrentChatPage); const dispatch = useDispatch(context); return ( {pages.map(page => ( 0 && ( )} onClick={() => dispatch(changeChatPage({ pageId: page.id, }))}> {page.name} ))}