usage.tsx 766 B

1234567891011121314151617181920212223242526272829303132
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import { useTranslation } from 'react-i18next'
  5. import { MessageFastPlus } from '../../base/icons/src/vender/line/communication'
  6. import UsageInfo from '../usage-info'
  7. import { useProviderContext } from '@/context/provider-context'
  8. type Props = {
  9. className?: string
  10. }
  11. const Usage: 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={MessageFastPlus}
  24. name={t('billing.annotatedResponse.quotaTitle')}
  25. usage={usage.annotatedResponse}
  26. total={total.annotatedResponse}
  27. />
  28. )
  29. }
  30. export default React.memo(Usage)