card.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { useTranslation } from 'react-i18next'
  2. import getMeta from '@/utils/meta'
  3. import useWaitForI18n from '@/shared/hooks/use-wait-for-i18n'
  4. import { Card as BSCard, CardBody, Col, Row } from 'react-bootstrap'
  5. import IconButton from '@/shared/components/button/icon-button'
  6. type CardProps = {
  7. children: React.ReactNode
  8. }
  9. function Card({ children }: CardProps) {
  10. const { t } = useTranslation()
  11. const groupName = getMeta('ol-groupName')
  12. const { isReady } = useWaitForI18n()
  13. if (!isReady) {
  14. return null
  15. }
  16. return (
  17. <div className="container">
  18. <Row>
  19. <Col xl={{ span: 4, offset: 4 }} md={{ span: 6, offset: 3 }}>
  20. <div className="group-heading" data-testid="group-heading">
  21. <IconButton
  22. variant="ghost"
  23. href="/user/subscription"
  24. size="lg"
  25. icon="arrow_back"
  26. accessibilityLabel={t('back_to_subscription')}
  27. />
  28. <h2>{groupName || t('group_subscription')}</h2>
  29. </div>
  30. <BSCard>
  31. <CardBody>{children}</CardBody>
  32. </BSCard>
  33. </Col>
  34. </Row>
  35. </div>
  36. )
  37. }
  38. export default Card