vector-space-info.tsx 826 B

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