index.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import cn from 'classnames'
  5. import { useTranslation } from 'react-i18next'
  6. import s from './style.module.css'
  7. import Config from '@/app/components/explore/universal-chat/config'
  8. import type { ProviderEnum } from '@/app/components/header/account-setting/model-page/declarations'
  9. import type { DataSet } from '@/models/datasets'
  10. type Props = {
  11. modelId: string
  12. providerName: ProviderEnum
  13. plugins: Record<string, boolean>
  14. dataSets: DataSet[]
  15. }
  16. const ConfigViewPanel: FC<Props> = ({
  17. modelId,
  18. providerName,
  19. plugins,
  20. dataSets,
  21. }) => {
  22. const { t } = useTranslation()
  23. return (
  24. <div className={cn('absolute top-9 right-0 z-20 p-4 bg-white rounded-2xl shadow-md', s.panelBorder)}>
  25. <div className='w-[368px]'>
  26. <Config
  27. readonly
  28. modelId={modelId}
  29. providerName={providerName}
  30. plugins={plugins}
  31. dataSets={dataSets}
  32. />
  33. <div className='mt-3 text-xs leading-[18px] text-500 font-normal'>{t('explore.universalChat.viewConfigDetailTip')}</div>
  34. </div>
  35. </div>
  36. )
  37. }
  38. export default React.memo(ConfigViewPanel)