fix: show table head when no item in page list (#2642)

This commit is contained in:
Whitewater
2023-06-01 01:31:51 -07:00
committed by GitHub
parent e1f715f837
commit 23126e1ff6
8 changed files with 183 additions and 416 deletions
+6 -3
View File
@@ -1,6 +1,7 @@
import { useTheme } from 'next-themes';
import type { CSSProperties } from 'react';
import { EmptySvg } from './empty-svg';
import { EmptyDarkSvg, EmptyLightSvg } from './empty-svg';
import { StyledEmptyContainer } from './style';
export type EmptyContentProps = {
containerStyle?: CSSProperties;
@@ -13,10 +14,12 @@ export const Empty = ({
description,
descriptionStyle,
}: EmptyContentProps) => {
const { theme } = useTheme();
const isDark = theme === 'dark';
return (
<StyledEmptyContainer style={containerStyle}>
<EmptySvg />
<p style={descriptionStyle}>{description}</p>
{isDark ? <EmptyDarkSvg /> : <EmptyLightSvg />}
<p style={{ marginTop: '30px', ...descriptionStyle }}>{description}</p>
</StyledEmptyContainer>
);
};