| | |
| | | import type { FC } from 'react' |
| | | import { useCallback } from 'react' |
| | | import { useTranslation } from 'react-i18next' |
| | | import { |
| | | RiArrowRightSLine, |
| | | } from '@remixicon/react' |
| | | import type { |
| | | CustomConfigurationModelFixedFields, |
| | | ModelItem, |
| | |
| | | // import Tab from './tab' |
| | | import AddModelButton from './add-model-button' |
| | | import ModelListItem from './model-list-item' |
| | | import { ChevronDownDouble } from '@/app/components/base/icons/src/vender/line/arrows' |
| | | import { useModalContextSelector } from '@/context/modal-context' |
| | | import { useAppContext } from '@/context/app-context' |
| | | |
| | |
| | | }, [onChange, provider, setShowModelLoadBalancingModal]) |
| | | |
| | | return ( |
| | | <div className='rounded-b-xl px-2 pb-2'> |
| | | <div className='rounded-lg bg-components-panel-bg py-1'> |
| | | <div className='px-2 pb-2 rounded-b-xl'> |
| | | <div className='py-1 bg-white rounded-lg'> |
| | | <div className='flex items-center pl-1 pr-[3px]'> |
| | | <span className='group mr-2 flex shrink-0 items-center'> |
| | | <span className='system-xs-medium inline-flex h-6 items-center pl-1 pr-1.5 text-text-tertiary group-hover:hidden'> |
| | | <span className='group shrink-0 flex items-center mr-2'> |
| | | <span className='group-hover:hidden pl-1 pr-1.5 h-6 leading-6 text-xs font-medium text-gray-500'> |
| | | {t('common.modelProvider.modelsNum', { num: models.length })} |
| | | <RiArrowRightSLine className='mr-0.5 h-4 w-4 rotate-90' /> |
| | | </span> |
| | | <span |
| | | className='system-xs-medium hidden h-6 cursor-pointer items-center rounded-lg bg-state-base-hover pl-1 pr-1.5 text-text-tertiary group-hover:inline-flex' |
| | | className='hidden group-hover:inline-flex items-center pl-1 pr-1.5 h-6 text-xs font-medium text-gray-500 bg-gray-50 cursor-pointer rounded-lg' |
| | | onClick={() => onCollapse()} |
| | | > |
| | | {t('common.modelProvider.modelsNum', { num: models.length })} |
| | | <RiArrowRightSLine className='mr-0.5 h-4 w-4 rotate-90' /> |
| | | <ChevronDownDouble className='mr-0.5 w-3 h-3 rotate-180' /> |
| | | {t('common.modelProvider.collapse')} |
| | | </span> |
| | | </span> |
| | | {/* { |
| | |
| | | } */} |
| | | { |
| | | isConfigurable && isCurrentWorkspaceManager && ( |
| | | <div className='flex grow justify-end'> |
| | | <div className='grow flex justify-end'> |
| | | <AddModelButton onClick={() => onConfig()} /> |
| | | </div> |
| | | ) |