vector-space-info.tsx 853 B

12345678910111213141516171819202122232425262728293031323334
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import { useTranslation } from 'react-i18next'
  5. import { ArtificialBrain } from '../../base/icons/src/vender/line/development'
  6. import UsageInfo from '../usage-info'
  7. import { useProviderContext } from '@/context/provider-context'
  8. type Props = {
  9. className?: string
  10. }
  11. const VectorSpaceInfo: FC<Props> = ({
  12. className,
  13. }) => {
  14. const { t } = useTranslation()
  15. const { plan } = useProviderContext()
  16. const {
  17. usage,
  18. total,
  19. } = plan
  20. return (
  21. <UsageInfo
  22. className={className}
  23. Icon={ArtificialBrain}
  24. name={t('billing.plansCommon.vectorSpace')}
  25. tooltip={t('billing.plansCommon.vectorSpaceTooltip') as string}
  26. usage={usage.vectorSpace}
  27. total={total.vectorSpace}
  28. unit='MB'
  29. />
  30. )
  31. }
  32. export default React.memo(VectorSpaceInfo)