Show different strings based on query length
If the query is less than 3 characters, we can prompt the user to type more. Otherwise, a result wasn't found.
This commit is contained in:
parent
963679ed95
commit
c07fdcb25c
1 changed files with 4 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ import classNames from 'classnames'
|
|||
|
||||
import styles from './index.module.scss'
|
||||
|
||||
type Props = Pick<SuggestionProps, 'items' | 'command'>
|
||||
type Props = Pick<SuggestionProps, 'items' | 'command' | 'query'>
|
||||
|
||||
export type MentionRef = {
|
||||
onKeyDown: (props: { event: KeyboardEvent }) => boolean
|
||||
|
|
@ -113,7 +113,9 @@ export const MentionList = forwardRef<MentionRef, Props>(
|
|||
))
|
||||
) : (
|
||||
<div className={styles.noResult}>
|
||||
{t('search.errors.no_results_generic')}
|
||||
{props.query.length < 3
|
||||
? t('search.errors.type')
|
||||
: t('search.errors.no_results_generic')}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue