forked from abner/for-legacy-web
feat(@ui): migrate category / overline and header
This commit is contained in:
@@ -5,9 +5,11 @@ import update from "dayjs/plugin/updateLocale";
|
||||
import defaultsDeep from "lodash.defaultsdeep";
|
||||
import { observer } from "mobx-react-lite";
|
||||
|
||||
import { IntlProvider } from "preact-i18n";
|
||||
import { IntlProvider, Text } from "preact-i18n";
|
||||
import { useCallback, useEffect, useState } from "preact/hooks";
|
||||
|
||||
import { Error } from "@revoltchat/ui";
|
||||
|
||||
import { useApplicationState } from "../mobx/State";
|
||||
|
||||
import { Languages } from "../../external/lang/Languages";
|
||||
@@ -143,3 +145,12 @@ function transformLanguage(source: Dictionary) {
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
export function I18nError({ error, children }: { error: any; children?: any }) {
|
||||
return (
|
||||
<Error
|
||||
error={error ? <Text id={error} children={error} /> : undefined}
|
||||
children={children}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user