mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(UI): update autocomplete no options text (#6735)
This commit is contained in:
@@ -9,6 +9,7 @@ import { AvatarData } from "components/AvatarData/AvatarData"
|
||||
import debounce from "just-debounce-it"
|
||||
import { ChangeEvent, FC, useEffect, useState } from "react"
|
||||
import { searchUserMachine } from "xServices/users/searchUserXService"
|
||||
import { useTranslation } from "react-i18next"
|
||||
|
||||
export type UserAutocompleteProps = {
|
||||
value: User | null
|
||||
@@ -24,6 +25,8 @@ export const UserAutocomplete: FC<UserAutocompleteProps> = ({
|
||||
className,
|
||||
}) => {
|
||||
const styles = useStyles()
|
||||
const { t } = useTranslation("common")
|
||||
|
||||
const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false)
|
||||
const [searchState, sendSearch] = useMachine(searchUserMachine)
|
||||
const { searchResults } = searchState.context
|
||||
@@ -46,6 +49,7 @@ export const UserAutocomplete: FC<UserAutocompleteProps> = ({
|
||||
|
||||
return (
|
||||
<Autocomplete
|
||||
noOptionsText={t("forms.typeToSearch")}
|
||||
className={className}
|
||||
options={searchResults}
|
||||
loading={searchState.matches("searching")}
|
||||
|
||||
@@ -41,5 +41,8 @@
|
||||
"error": "Coder update check failed."
|
||||
},
|
||||
"licenseFieldTextHelper": "You need an enterprise license to use it.",
|
||||
"learnMore": "Learn more"
|
||||
"learnMore": "Learn more",
|
||||
"forms": {
|
||||
"typeToSearch": "Start typing to search..."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user