@@ -6,6 +6,7 @@ import didUpdate from "@ember/render-modifiers/modifiers/did-update";
66import { service } from " @ember/service" ;
77import DToggleSwitch from " discourse/components/d-toggle-switch" ;
88import { SEARCH_TYPE_DEFAULT } from " discourse/controllers/full-page-search" ;
9+ import concatClass from " discourse/helpers/concat-class" ;
910import { ajax } from " discourse/lib/ajax" ;
1011import { isValidSearchTerm , translateResults } from " discourse/lib/search" ;
1112import icon from " discourse-common/helpers/d-icon" ;
@@ -135,6 +136,16 @@ export default class AiFullPageSearch extends Component {
135136 );
136137 }
137138
139+ get searchClass () {
140+ if (! this .validSearchOrder ) {
141+ return " unavailable" ;
142+ } else if (this .searching ) {
143+ return " in-progress" ;
144+ } else if (this .noResults ) {
145+ return " no-results" ;
146+ }
147+ }
148+
138149 get tooltipText () {
139150 return i18n (
140151 ` discourse_ai.embeddings.semantic_search_tooltips.${
@@ -209,10 +220,7 @@ export default class AiFullPageSearch extends Component {
209220 <div class =" semantic-search__container search-results" role =" region" >
210221 <div class =" semantic-search__results" >
211222 <div
212- class =" semantic-search__searching
213- {{if this . searching ' in-progress' }}
214- {{if this . noResults ' no-results' }}
215- {{unless this . validSearchOrder ' unavailable' }} "
223+ class ={{concatClass " semantic-search__searching" this . searchClass}}
216224 >
217225 <DToggleSwitch
218226 disabled ={{this .disableToggleSwitch }}
0 commit comments