Skip to content

Commit 1ccbd54

Browse files
authored
chore(UI): update autocomplete no options text (#6735)
1 parent f1d7809 commit 1ccbd54

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

site/src/components/UserAutocomplete/UserAutocomplete.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { AvatarData } from "components/AvatarData/AvatarData"
99
import debounce from "just-debounce-it"
1010
import { ChangeEvent, FC, useEffect, useState } from "react"
1111
import { searchUserMachine } from "xServices/users/searchUserXService"
12+
import { useTranslation } from "react-i18next"
1213

1314
export type UserAutocompleteProps = {
1415
value: User | null
@@ -24,6 +25,8 @@ export const UserAutocomplete: FC<UserAutocompleteProps> = ({
2425
className,
2526
}) => {
2627
const styles = useStyles()
28+
const { t } = useTranslation("common")
29+
2730
const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false)
2831
const [searchState, sendSearch] = useMachine(searchUserMachine)
2932
const { searchResults } = searchState.context
@@ -46,6 +49,7 @@ export const UserAutocomplete: FC<UserAutocompleteProps> = ({
4649

4750
return (
4851
<Autocomplete
52+
noOptionsText={t("forms.typeToSearch")}
4953
className={className}
5054
options={searchResults}
5155
loading={searchState.matches("searching")}

site/src/i18n/en/common.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@
4141
"error": "Coder update check failed."
4242
},
4343
"licenseFieldTextHelper": "You need an enterprise license to use it.",
44-
"learnMore": "Learn more"
44+
"learnMore": "Learn more",
45+
"forms": {
46+
"typeToSearch": "Start typing to search..."
47+
}
4548
}

0 commit comments

Comments
 (0)