@@ -10,7 +10,7 @@ import { EditFormat } from '@shared/types/edit-format'
1010import { TARGET , Target } from '@shared/types/mode'
1111import { ApiPromptType , WebPromptType } from '@shared/types/prompt-types'
1212import { Scrollable as UiScrollable } from '@ui/components/editor/common/Scrollable'
13- import { BrowserExtensionNotice as UiBrowserExtensionNotice } from '@ui/components/editor/prompt/BrowserExtensionNotice '
13+ import { BrowserExtensionMessage as UiBrowserExtensionMessage } from '@ui/components/editor/prompt/BrowserExtensionMessage '
1414import { ApiConfiguration } from '@/views/prompt/types/messages'
1515import { use_last_choice_tooltip } from './hooks/use-last-choice-tooltip'
1616import { Header } from './components/Header'
@@ -364,72 +364,70 @@ export const MainView: React.FC<Props> = (props) => {
364364 />
365365 </ div >
366366
367- < div className = { styles [ 'notices' ] } >
368- < UiPromptNotice
369- warning = {
370- context_is_empty_warning
371- ? t ( 'common.context-is-empty' )
372- : undefined
373- }
374- token_count = { props . selected_files_token_count }
375- files_count = {
376- context_is_empty_warning
377- ? undefined
378- : props . selected_files . length
379- }
380- translations = { {
381- attaching_files : t ( 'selected-files.attaching-files' )
382- } }
383- />
384- { props . target == TARGET . WEB && ! props . is_connected && (
385- < UiBrowserExtensionNotice />
386- ) }
387- </ div >
367+ < UiPromptNotice
368+ warning = {
369+ context_is_empty_warning
370+ ? t ( 'common.context-is-empty' )
371+ : undefined
372+ }
373+ token_count = { props . selected_files_token_count }
374+ files_count = {
375+ context_is_empty_warning ? undefined : props . selected_files . length
376+ }
377+ translations = { {
378+ attaching_files : t ( 'selected-files.attaching-files' )
379+ } }
380+ />
388381
389382 < UiSeparator height = { 6 } />
390383
391- { props . target == TARGET . WEB && props . is_connected && (
392- < UiConfigurations
393- configurations = { web_configurations }
394- disable_invocation = {
395- context_is_empty_warning || ! props . is_connected
396- }
397- on_create = { ( params ) => {
398- props . on_create_web_configuration ( params )
399- } }
400- on_configuration_click = { ( id ) => {
401- props . initialize_chats ( {
402- web_configuration_name : id ,
403- show_quick_pick : false
404- } )
405- } }
406- on_edit = { ( id ) => props . on_web_configuration_edit ( id ) }
407- on_reorder = { ( reordered ) => {
408- const new_web_configurations = reordered . map ( ( c ) => {
409- return props . web_configurations . find (
410- ( p , i ) => ( p . name ?? `unnamed-${ i } ` ) == c . id
411- ) !
412- } )
413- props . on_web_configurations_reorder ( new_web_configurations )
414- } }
415- on_delete = { ( id ) => {
416- props . on_delete_web_configuration ( id )
417- } }
418- on_toggle_pinned = { ( id ) => {
419- props . on_toggle_web_configuration_pinned ( id )
420- } }
421- selected_configuration_id = { props . selected_web_configuration_name }
422- translations = { {
423- empty : t ( 'configurations.empty' ) ,
424- add_new : t ( 'action.add-new' ) ,
425- pin : t ( 'action.pin' ) ,
426- unpin : t ( 'action.unpin' ) ,
427- insert : t ( 'action.insert-configuration' ) ,
428- edit : t ( 'action.edit' ) ,
429- delete : t ( 'action.delete' )
430- } }
431- />
432- ) }
384+ { props . target == TARGET . WEB &&
385+ ( props . is_connected ? (
386+ < UiConfigurations
387+ configurations = { web_configurations }
388+ disable_invocation = {
389+ context_is_empty_warning || ! props . is_connected
390+ }
391+ on_create = { ( params ) => {
392+ props . on_create_web_configuration ( params )
393+ } }
394+ on_configuration_click = { ( id ) => {
395+ props . initialize_chats ( {
396+ web_configuration_name : id ,
397+ show_quick_pick : false
398+ } )
399+ } }
400+ on_edit = { ( id ) => props . on_web_configuration_edit ( id ) }
401+ on_reorder = { ( reordered ) => {
402+ const new_web_configurations = reordered . map ( ( c ) => {
403+ return props . web_configurations . find (
404+ ( p , i ) => ( p . name ?? `unnamed-${ i } ` ) == c . id
405+ ) !
406+ } )
407+ props . on_web_configurations_reorder ( new_web_configurations )
408+ } }
409+ on_delete = { ( id ) => {
410+ props . on_delete_web_configuration ( id )
411+ } }
412+ on_toggle_pinned = { ( id ) => {
413+ props . on_toggle_web_configuration_pinned ( id )
414+ } }
415+ selected_configuration_id = {
416+ props . selected_web_configuration_name
417+ }
418+ translations = { {
419+ empty : t ( 'configurations.empty' ) ,
420+ add_new : t ( 'action.add-new' ) ,
421+ pin : t ( 'action.pin' ) ,
422+ unpin : t ( 'action.unpin' ) ,
423+ insert : t ( 'action.insert-configuration' ) ,
424+ edit : t ( 'action.edit' ) ,
425+ delete : t ( 'action.delete' )
426+ } }
427+ />
428+ ) : (
429+ < UiBrowserExtensionMessage />
430+ ) ) }
433431
434432 { props . target == TARGET . API && (
435433 < UiConfigurations
0 commit comments