import { useState } from 'react'; import { useDispatch, useSelector } from 'tgui/backend'; import { Button, Collapsible, Input, LabeledList, NoticeBox, Section, Slider, Stack } from 'tgui-core/components'; import { toFixed } from 'tgui-core/math'; import { capitalize } from 'tgui-core/string'; import { updateSettings } from './actions'; import { FONTS } from './constants'; import { selectSettings } from './selectors'; export const SettingsStatPanel = (props) => { const { statLinked, statFontSize, statFontFamily, statTabsStyle } = useSelector(selectSettings); const dispatch = useDispatch(); const TabsViews = ['default', 'classic', 'scrollable']; const LinkedToChat = () => ( Unlink Stat Panel from chat! ); const [freeStatFont, setFreeStatFont] = useState(false); return (
{TabsViews.map((view) => ( ))} {statLinked ? ( ) : ( {!freeStatFont ? ( { setFreeStatFont(!freeStatFont); }} > Custom font } > {FONTS.map((FONT) => ( ))} ) : ( dispatch( updateSettings({ statFontFamily: value, }) ) } /> )} )} {statLinked ? ( ) : ( toFixed(value)} onChange={(e, value) => dispatch(updateSettings({ statFontSize: value }))} /> )}
); };