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