StatsError.tsx 780 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React, { FC } from 'react';
  2. import styled from 'styled-components';
  3. import { Flex } from 'reflexbox/styled-components';
  4. interface Props {
  5. text?: string;
  6. }
  7. const ErrorMessage = styled.h3`
  8. font-size: 24px;
  9. font-weight: 300;
  10. @media only screen and (max-width: 768px) {
  11. font-size: 18px;
  12. }
  13. `;
  14. const Icon = styled.img`
  15. width: 24px;
  16. height: 24px;
  17. margin: 6px 12px 0 0;
  18. @media only screen and (max-width: 768px) {
  19. width: 18px;
  20. height: 18px;
  21. }
  22. `;
  23. const StatsError: FC<Props> = ({ text }) => (
  24. <Flex justifyContent="center" alignItems="center">
  25. <Icon src="/images/x.svg" />
  26. <ErrorMessage>{text || 'Could not get the short URL stats.'}</ErrorMessage>
  27. </Flex>
  28. );
  29. StatsError.defaultProps = {
  30. text: '',
  31. };
  32. export default StatsError;