index.tsx 794 B

12345678910111213141516171819
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import { useTranslation } from 'react-i18next'
  5. import type { MessageMore } from '../type'
  6. import { formatNumber } from '@/utils/format'
  7. export type IMoreInfoProps = { more: MessageMore; isQuestion: boolean }
  8. const MoreInfo: FC<IMoreInfoProps> = ({ more, isQuestion }) => {
  9. const { t } = useTranslation()
  10. return (<div className={`mt-1 space-x-2 text-xs text-gray-400 ${isQuestion ? 'mr-2 text-right ' : 'ml-2 text-left float-right'}`}>
  11. <span>{`${t('appLog.detail.timeConsuming')} ${more.latency}${t('appLog.detail.second')}`}</span>
  12. <span>{`${t('appLog.detail.tokenCost')} ${formatNumber(more.tokens)}`}</span>
  13. <span>· </span>
  14. <span>{more.time} </span>
  15. </div>)
  16. }
  17. export default React.memo(MoreInfo)