word-counts.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { FC } from 'react'
  2. import { ServerWordCountData } from '@/features/word-count-modal/components/word-count-data'
  3. import { useTranslation } from 'react-i18next'
  4. import { Container, Row, Col } from 'react-bootstrap'
  5. import OLNotification from '@/features/ui/components/ol/ol-notification'
  6. export const WordCounts: FC<{
  7. data: ServerWordCountData
  8. }> = ({ data }) => {
  9. const { t } = useTranslation()
  10. return (
  11. <Container fluid>
  12. {data.messages && (
  13. <Row>
  14. <Col xs={12}>
  15. <OLNotification
  16. type="error"
  17. content={
  18. <p style={{ whiteSpace: 'pre-wrap' }}>{data.messages}</p>
  19. }
  20. />
  21. </Col>
  22. </Row>
  23. )}
  24. <Row>
  25. <Col xs={4}>
  26. <div className="pull-right">{t('total_words')}:</div>
  27. </Col>
  28. <Col xs={6}>{data.textWords}</Col>
  29. </Row>
  30. <Row>
  31. <Col xs={4}>
  32. <div className="pull-right">{t('headers')}:</div>
  33. </Col>
  34. <Col xs={6}>{data.headers}</Col>
  35. </Row>
  36. <Row>
  37. <Col xs={4}>
  38. <div className="pull-right">{t('math_inline')}:</div>
  39. </Col>
  40. <Col xs={6}>{data.mathInline}</Col>
  41. </Row>
  42. <Row>
  43. <Col xs={4}>
  44. <div className="pull-right">{t('math_display')}:</div>
  45. </Col>
  46. <Col xs={6}>{data.mathDisplay}</Col>
  47. </Row>
  48. </Container>
  49. )
  50. }