import * as React from 'react';
import { Empty as AntEmpty } from 'antd';
import { useMemo } from 'react';
import { Util } from '@/utils';

interface IComponentProps {
  description?: React.ReactNode;
  children?: React.ReactNode;
  imageStyle?: React.CSSProperties;
}
const Empty: React.FC<IComponentProps> = ({
  description,
  children,
  imageStyle = {},
  ...rest
}) => {
  const image = useMemo(() => {
    // @ts-ignore
    return `${Util.getPublicPath()}empty.png`;
  }, []);

  return (
    <AntEmpty
      image={image}
      imageStyle={imageStyle}
      description={description}
      {...rest}
    >
      {children}
    </AntEmpty>
  );
};

export default Empty;
