import { Fragment } from 'react' import type { FC } from 'react' import { Popover, Transition } from '@headlessui/react' import { useTranslation } from 'react-i18next' import { RiCheckLine, RiMoreFill, } from '@remixicon/react' import { PreferredProviderTypeEnum } from '../declarations' import Button from '@/app/components/base/button' type SelectorProps = { value?: string onSelect: (key: PreferredProviderTypeEnum) => void } const Selector: FC = ({ value, onSelect, }) => { const { t } = useTranslation() const options = [ { key: PreferredProviderTypeEnum.custom, text: t('common.modelProvider.apiKey'), }, { key: PreferredProviderTypeEnum.system, text: t('common.modelProvider.quota'), }, ] return ( { ({ open }) => ( ) }
{t('common.modelProvider.card.priorityUse')}
{ options.map(option => (
onSelect(option.key)} >
{option.text}
{value === option.key && }
)) }
) } export default Selector