From 24ce681c287a9b567cf3cd4f14e87d7843603dd1 Mon Sep 17 00:00:00 2001 From: shiyu Date: Fri, 29 Aug 2025 12:55:53 +0800 Subject: [PATCH] refactor: Simplify EmptyState component --- .../pages/FileExplorerPage/FileExplorerPage.tsx | 2 +- .../FileExplorerPage/components/EmptyState.tsx | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/web/src/pages/FileExplorerPage/FileExplorerPage.tsx b/web/src/pages/FileExplorerPage/FileExplorerPage.tsx index a6233c7..af8addf 100644 --- a/web/src/pages/FileExplorerPage/FileExplorerPage.tsx +++ b/web/src/pages/FileExplorerPage/FileExplorerPage.tsx @@ -109,7 +109,7 @@ const FileExplorerPage = memo(function FileExplorerPage() {
0 ? '80px' : '0' }} onContextMenu={openBlankContextMenu}> {loading && entries.length === 0 ? ( -
setCreatingDir(true)} onGoUp={goUp} />
+
) : viewMode === 'grid' ? ( void; - onGoUp: () => void; } -export const EmptyState: React.FC = ({ isRoot, onCreateDir, onGoUp }) => { +export const EmptyState: React.FC = ({ isRoot }) => { const { token } = theme.useToken(); return (
@@ -19,15 +17,6 @@ export const EmptyState: React.FC = ({ isRoot, onCreateDir, onGoUp }) => {isRoot ? '开始上传文件或创建新目录来组织您的内容' : '您可以在此目录中创建新的文件夹或上传文件'} - - - - - {!isRoot && ( -
- -
- )}
); };