diff --git a/src/assistant/AssistantWrapperMobile.jsx b/src/assistant/AssistantWrapperMobile.jsx index ad9407e21..34e82130a 100644 --- a/src/assistant/AssistantWrapperMobile.jsx +++ b/src/assistant/AssistantWrapperMobile.jsx @@ -25,6 +25,8 @@ export const AssistantWrapperMobile = () => { const { t } = useI18n() const navigate = useNavigate() + const isAssistantEnabled = flag('cozy.assistant.enabled') + return (
{ } type="button" - label={t('assistant.search.placeholder')} + label={ + isAssistantEnabled ? t('assistant.search.placeholder') : undefined // Fallback on SearchBar default + } onClick={() => navigate('connected/search')} />
diff --git a/src/assistant/Search/SearchBarDesktop.jsx b/src/assistant/Search/SearchBarDesktop.jsx index e22846ed6..b4ec4d906 100644 --- a/src/assistant/Search/SearchBarDesktop.jsx +++ b/src/assistant/Search/SearchBarDesktop.jsx @@ -24,8 +24,10 @@ const SearchBarDesktop = ({ value, onClear, onChange }) => { const searchRef = useRef() const listRef = useRef() + const isAssistantEnabled = flag('cozy.assistant.enabled') + const handleClick = () => { - if (!flag('cozy.assistant.enabled')) return + if (!isAssistantEnabled) return const conversationId = makeConversationId() onAssistantExecute({ value, conversationId }) @@ -84,7 +86,9 @@ const SearchBarDesktop = ({ value, onClear, onChange }) => { ref={searchRef} size="large" icon={} - placeholder={t('assistant.search.placeholder')} + placeholder={ + isAssistantEnabled ? t('assistant.search.placeholder') : undefined // Fallback on SearchBar default + } value={value} componentsProps={{ inputBase: { onKeyDown: handleKeyDown }