|
1 | | -import { useState, useRef, useEffect, useCallback, useMemo } from 'react' |
| 1 | +import { useState, useRef, useEffect, useCallback } from 'react' |
2 | 2 | import { Layout as UiLayout } from '@ui/components/editor/settings/Layout' |
3 | 3 | import { NavigationItem as UiNavigationItem } from '@ui/components/editor/settings/NavigationItem' |
4 | 4 | import { ModelProvidersSection } from './sections/ModelProvidersSection' |
@@ -183,10 +183,6 @@ export const Home: React.FC<Props> = (props) => { |
183 | 183 | useState('') |
184 | 184 | const [stuck_sections, set_stuck_sections] = useState(new Set<NavItem>()) |
185 | 185 |
|
186 | | - const has_anthropic_provider = useMemo(() => { |
187 | | - return props.providers.some((p) => p.name == 'Anthropic') |
188 | | - }, [props.providers]) |
189 | | - |
190 | 186 | const handle_stuck_change = useCallback((id: NavItem, is_stuck: boolean) => { |
191 | 187 | set_stuck_sections((prev) => { |
192 | 188 | const is_currently_stuck = prev.has(id) |
@@ -426,22 +422,20 @@ export const Home: React.FC<Props> = (props) => { |
426 | 422 | on_edit_provider={props.on_edit_provider} |
427 | 423 | on_change_api_key={props.on_change_api_key} |
428 | 424 | /> |
429 | | - {has_anthropic_provider && ( |
430 | | - <UiItem |
431 | | - title={t('model-providers.extended-cache.anthropic.title')} |
432 | | - description={t( |
433 | | - 'model-providers.extended-cache.anthropic.description' |
434 | | - )} |
435 | | - slot_right={ |
436 | | - <UiToggler |
437 | | - is_on={props.extended_cache_duration_for_anthropic} |
438 | | - on_toggle={ |
439 | | - props.on_extended_cache_duration_for_anthropic_change |
440 | | - } |
441 | | - /> |
442 | | - } |
443 | | - /> |
444 | | - )} |
| 425 | + <UiItem |
| 426 | + title={t('model-providers.extended-cache.anthropic.title')} |
| 427 | + description={t( |
| 428 | + 'model-providers.extended-cache.anthropic.description' |
| 429 | + )} |
| 430 | + slot_right={ |
| 431 | + <UiToggler |
| 432 | + is_on={props.extended_cache_duration_for_anthropic} |
| 433 | + on_toggle={ |
| 434 | + props.on_extended_cache_duration_for_anthropic_change |
| 435 | + } |
| 436 | + /> |
| 437 | + } |
| 438 | + /> |
445 | 439 | </UiGroup> |
446 | 440 | </UiSection> |
447 | 441 | <UiSection |
|
0 commit comments