mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +01:00
tidy up suggestions api (#1699)
Streamlines the suggestions/autocomplete api and removes redundancy. All logic accessing the backend is now in hooks in ui-api.
This commit is contained in:
committed by
GitHub
parent
e5e79398d2
commit
17ecec03b2
@@ -21,24 +21,21 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
import React from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import AutocompleteProps from "./UserGroupAutocomplete";
|
||||
import UserGroupAutocomplete from "./UserGroupAutocomplete";
|
||||
import React, { FC } from "react";
|
||||
import UserGroupAutocomplete, { AutocompleteProps } from "./UserGroupAutocomplete";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
class GroupAutocomplete extends React.Component<AutocompleteProps & WithTranslation> {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<UserGroupAutocomplete
|
||||
label={t("autocomplete.group")}
|
||||
noOptionsMessage={t("autocomplete.noGroupOptions")}
|
||||
loadingMessage={t("autocomplete.loading")}
|
||||
placeholder={t("autocomplete.groupPlaceholder")}
|
||||
{...this.props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
const GroupAutocomplete: FC<AutocompleteProps> = (props) => {
|
||||
const [t] = useTranslation("commons");
|
||||
return (
|
||||
<UserGroupAutocomplete
|
||||
label={t("autocomplete.group")}
|
||||
noOptionsMessage={t("autocomplete.noGroupOptions")}
|
||||
loadingMessage={t("autocomplete.loading")}
|
||||
placeholder={t("autocomplete.groupPlaceholder")}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default withTranslation("commons")(GroupAutocomplete);
|
||||
export default GroupAutocomplete;
|
||||
|
||||
Reference in New Issue
Block a user