@@ -6,6 +6,7 @@ interface EmptyProps {
|
||||
url?: string;
|
||||
size?: number | number[];
|
||||
title?: string;
|
||||
isNeedSubTitle?: boolean;
|
||||
subTitle?: string;
|
||||
className?: string;
|
||||
}
|
||||
@@ -13,6 +14,7 @@ const Empty: FC<EmptyProps> = ({
|
||||
url,
|
||||
size = 200,
|
||||
title,
|
||||
isNeedSubTitle = true,
|
||||
subTitle,
|
||||
className = '',
|
||||
}) => {
|
||||
@@ -20,12 +22,12 @@ const Empty: FC<EmptyProps> = ({
|
||||
const width = Array.isArray(size) ? size[0] : size ? size : url ? 200 : 88;
|
||||
const height = Array.isArray(size) ? size[1] : size ? size : url ? 200 : 88;
|
||||
|
||||
subTitle = subTitle || t('empty.tableEmpty');
|
||||
const curSubTitle = isNeedSubTitle ? (subTitle || t('empty.tableEmpty')) : null;
|
||||
return (
|
||||
<div className={`rb:flex rb:items-center rb:justify-center rb:flex-col ${className}`}>
|
||||
<img src={url || emptyIcon} alt="404" style={{ width: `${width}px`, height: `${height}px` }} />
|
||||
{title && <div className="rb:mt-[8px] rb:leading-[20px]">{title}</div>}
|
||||
{subTitle && <div className={`rb:mt-[${url ? 8 : 5}px] rb:leading-[16px] rb:text-[#5B6167]`}>{subTitle}</div>}
|
||||
{title && <div className="rb:mt-2 rb:leading-5">{title}</div>}
|
||||
{curSubTitle && <div className={`rb:mt-[${url ? 8 : 5}px] rb:leading-4 rb:text-[12px] rb:text-[#A8A9AA]`}>{subTitle}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user