import { Text } from "preact-i18n"; import styles from "./Panes.module.scss"; import Tip from "../../../components/ui/Tip"; import Emoji from "../../../components/common/Emoji"; import Checkbox from "../../../components/ui/Checkbox"; import { connectState } from "../../../redux/connector"; import { WithDispatcher } from "../../../redux/reducers"; import { Language, LanguageEntry, Languages as Langs } from "../../../context/Locale"; interface Props { locale: Language; } export function Component({ locale, dispatcher }: Props & WithDispatcher) { return (

{Object.keys(Langs).map(x => { const l = (Langs as any)[x] as LanguageEntry; return ( { if (v) { dispatcher({ type: "SET_LOCALE", locale: x as Language }); } }} >
{l.display}
); })}
{" "}
); } export const Languages = connectState( Component, state => { return { locale: state.locale }; }, true );