feat: display error on selection of invalid model (#594)
Up-to-date of #78 Fixes #32 addressed requested changes @tibo-openai :) made sense to me though, previous rationale with passing the state up was assuming there could be a future need to have a shared state with all available models being available to the parent
This commit is contained in:
@@ -19,7 +19,7 @@ type Props = {
|
||||
currentProvider?: string;
|
||||
hasLastResponse: boolean;
|
||||
providers?: Record<string, { name: string; baseURL: string; envKey: string }>;
|
||||
onSelect: (model: string) => void;
|
||||
onSelect: (allModels: Array<string>, model: string) => void;
|
||||
onSelectProvider?: (provider: string) => void;
|
||||
onExit: () => void;
|
||||
};
|
||||
@@ -153,7 +153,12 @@ export default function ModelOverlay({
|
||||
}
|
||||
initialItems={items}
|
||||
currentValue={currentModel}
|
||||
onSelect={onSelect}
|
||||
onSelect={() =>
|
||||
onSelect(
|
||||
items?.map((m) => m.value),
|
||||
currentModel,
|
||||
)
|
||||
}
|
||||
onExit={onExit}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user