Web: Client: Data Import: replace translation injection with translation hook

This commit is contained in:
Vladimir Khvan 2024-06-21 14:29:21 +05:00
parent 99a53fc435
commit 3bd39de506

View File

@ -25,7 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import { inject, observer } from "mobx-react";
import { withTranslation } from "react-i18next";
import { useTranslation } from "react-i18next";
import { Consumer } from "@docspace/shared/utils/context";
import TableView from "./TableView";
@ -39,7 +39,6 @@ const checkedAccountType = "result";
const AccountsTable = (props: AccountsTableProps) => {
const {
t,
accountsData,
viewAs,
changeGroupType,
@ -47,6 +46,8 @@ const AccountsTable = (props: AccountsTableProps) => {
toggleAllAccounts,
} = props as InjectedTypeSelectTableProps;
const { t, ready } = useTranslation(["ChangeUserTypeDialog", "People"]);
const setTypeDocspaceAdmin = () => {
changeGroupType(UserTypes.DocSpaceAdmin);
toggleAllAccounts(false, [], checkedAccountType);
@ -78,6 +79,8 @@ const AccountsTable = (props: AccountsTableProps) => {
},
];
if (!ready) return;
return (
<Consumer>
{(context) =>
@ -110,6 +113,4 @@ export default inject<TStore>(({ setup, importAccountsStore }) => {
UserTypes,
toggleAllAccounts,
};
})(
withTranslation(["ChangeUserTypeDialog", "People"])(observer(AccountsTable)),
);
})(observer(AccountsTable));