From 84600cb20db76f0528d1b9daed66bec4a29b45ef Mon Sep 17 00:00:00 2001 From: Katherine Date: Sat, 7 Sep 2024 08:55:08 +0800 Subject: [PATCH] refactor: collectionNotAllowViewPlaceholder (#5224) --- .../CollectionDeletedPlaceholder.tsx | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/core/client/src/data-source/components/CollectionDeletedPlaceholder.tsx b/packages/core/client/src/data-source/components/CollectionDeletedPlaceholder.tsx index 8a7bf0366b..024b938f38 100644 --- a/packages/core/client/src/data-source/components/CollectionDeletedPlaceholder.tsx +++ b/packages/core/client/src/data-source/components/CollectionDeletedPlaceholder.tsx @@ -114,11 +114,7 @@ export const CollectionDeletedPlaceholder: FC return null; }; -/** - * @internal - */ -export const CollectionNotAllowViewPlaceholder: FC = () => { - const { designable } = useDesignable(); +const CollectionNotAllowView = () => { const { t } = useTranslation(); const dataSource = useDataSource(); const compile = useCompile(); @@ -146,13 +142,21 @@ export const CollectionNotAllowViewPlaceholder: FC = () => { }, ).replaceAll('>', '>'); }, [nameValue, t]); + return ( + + + + ); +}; + +/** + * @internal + */ +export const CollectionNotAllowViewPlaceholder: FC = () => { + const { designable } = useDesignable(); if (designable) { - return ( - - - - ); + return ; } return null;