EmptyPage.tsx 972 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import clsx from 'clsx';
  2. import Image from 'next/image';
  3. import React from 'react';
  4. import { Button } from '../Button';
  5. import styles from './EmptyPage.module.scss';
  6. interface IProps {
  7. title: string;
  8. subtitle?: string;
  9. onAction?: () => void;
  10. actionLabel?: string;
  11. }
  12. export const EmptyPage: React.FC<IProps> = ({ title, subtitle, onAction, actionLabel }) => (
  13. <div data-testid="empty-page" className="card empty">
  14. <Image
  15. src="/empty.svg"
  16. alt="Empty box"
  17. height="80"
  18. width="80"
  19. className={clsx(styles.emptyImage, 'mb-3')}
  20. style={{
  21. maxWidth: '100%',
  22. height: '80px',
  23. }}
  24. />
  25. <p className="empty-title">{title}</p>
  26. <p className="empty-subtitle text-muted">{subtitle}</p>
  27. <div className="empty-action">
  28. {onAction && (
  29. <Button data-testid="empty-page-action" onClick={onAction} className="btn-primary">
  30. {actionLabel}
  31. </Button>
  32. )}
  33. </div>
  34. </div>
  35. );