index.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 { DataSet } from '@/models/datasets'
  9. type Props = {
  10. modelId: string
  11. providerName: string
  12. plugins: Record<string, boolean>
  13. dataSets: DataSet[]
  14. }
  15. const ConfigViewPanel: FC<Props> = ({
  16. modelId,
  17. providerName,
  18. plugins,
  19. dataSets,
  20. }) => {
  21. const { t } = useTranslation()
  22. return (
  23. <div className={cn('absolute top-9 right-0 z-20 p-4 bg-white rounded-2xl shadow-md', s.panelBorder)}>
  24. <div className='w-[368px]'>
  25. <Config
  26. readonly
  27. modelId={modelId}
  28. providerName={providerName}
  29. plugins={plugins}
  30. dataSets={dataSets}
  31. />
  32. <div className='mt-3 text-xs leading-[18px] text-500 font-normal'>{t('explore.universalChat.viewConfigDetailTip')}</div>
  33. </div>
  34. </div>
  35. )
  36. }
  37. export default React.memo(ConfigViewPanel)