@@ -12,7 +12,7 @@ import { TARGET, Target } from '@shared/types/mode'
1212import { ApiPromptType , WebPromptType } from '@shared/types/prompt-types'
1313import { Scrollable as UiScrollable } from '@ui/components/editor/common/Scrollable'
1414import { BrowserConnectionStatus } from './components/BrowserConnectionStatus'
15- import { ApiConfiguration } from '@/views/prompt/types/messages'
15+ import { ApiConfiguration , SetupProgress } from '@/views/prompt/types/messages'
1616import { use_last_choice_tooltip } from './hooks/use-last-choice-tooltip'
1717import { use_keyboard_shortcuts } from './hooks/use-keyboard-shortcuts'
1818import { Header } from './components/Header'
@@ -52,6 +52,7 @@ type Props = {
5252 exact_insertion ?: boolean
5353 } ) => void
5454 on_manage_models : ( ) => void
55+ on_manage_providers : ( ) => void
5556 on_manage_chatbots : ( ) => void
5657 currently_open_file_path ?: string
5758 current_selection ?: SelectionState | null
@@ -105,6 +106,7 @@ type Props = {
105106 on_recording_started : ( ) => void
106107 on_recording_finished : ( ) => void
107108 is_setup_complete : boolean
109+ setup_progress ?: SetupProgress
108110 tabs_count : number
109111 active_tab_index : number
110112 on_tab_change : ( index : number ) => void
@@ -304,25 +306,49 @@ export const MainView: React.FC<Props> = (props) => {
304306 </ >
305307 ) }
306308
307- { props . target == TARGET . API && props . api_configurations . length == 0 && (
308- < >
309- < UiStatusBar
310- theme = "warning"
311- icon = "codicon-warning"
312- label = { t ( 'configurations.missing-model' ) }
313- actions = { [
314- {
315- id : 'settings' ,
316- icon : 'codicon-gear' ,
317- label : t ( 'action.settings' ) ,
318- title : t ( 'action.settings' ) ,
319- on_click : props . on_manage_models
320- }
321- ] }
322- />
323- < UiSeparator height = { 4 } />
324- </ >
325- ) }
309+ { props . target == TARGET . API &&
310+ props . setup_progress &&
311+ ! props . setup_progress . has_provider && (
312+ < >
313+ < UiStatusBar
314+ theme = "warning"
315+ icon = "codicon-warning"
316+ label = { t ( 'providers.missing-provider' ) }
317+ actions = { [
318+ {
319+ id : 'settings' ,
320+ icon : 'codicon-gear' ,
321+ label : t ( 'action.settings' ) ,
322+ title : t ( 'action.settings' ) ,
323+ on_click : props . on_manage_providers
324+ }
325+ ] }
326+ />
327+ < UiSeparator height = { 4 } />
328+ </ >
329+ ) }
330+
331+ { props . target == TARGET . API &&
332+ props . setup_progress ?. has_provider &&
333+ props . api_configurations . length == 0 && (
334+ < >
335+ < UiStatusBar
336+ theme = "warning"
337+ icon = "codicon-warning"
338+ label = { t ( 'configurations.missing-model' ) }
339+ actions = { [
340+ {
341+ id : 'settings' ,
342+ icon : 'codicon-gear' ,
343+ label : t ( 'action.settings' ) ,
344+ title : t ( 'action.settings' ) ,
345+ on_click : props . on_manage_models
346+ }
347+ ] }
348+ />
349+ < UiSeparator height = { 4 } />
350+ </ >
351+ ) }
326352
327353 < UiSeparator height = { 2 } />
328354
0 commit comments