import { Empty, EmptyProps, Skeleton, SkeletonProps } from 'antd' import { cloneElement, memo } from 'react' export type SkeletonLoaderProps = SkeletonProps & { empty?: boolean loading?: boolean children: JSX.Element emptyNode?: JSX.Element emptyProps?: EmptyProps } export const SkeletonLoader = memo(({ loading, empty, children, emptyNode = , emptyProps, ...other }) => { if (loading) return if (empty) return cloneElement(emptyNode, emptyProps) return children }) export default SkeletonLoader