refactor: collectionNotAllowViewPlaceholder (#5224)

This commit is contained in:
Katherine 2024-09-07 08:55:08 +08:00 committed by GitHub
parent c3732efaec
commit 84600cb20d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -114,11 +114,7 @@ export const CollectionDeletedPlaceholder: FC<CollectionDeletedPlaceholderProps>
return null;
};
/**
* @internal
*/
export const CollectionNotAllowViewPlaceholder: FC<any> = () => {
const { designable } = useDesignable();
const CollectionNotAllowView = () => {
const { t } = useTranslation();
const dataSource = useDataSource();
const compile = useCompile();
@ -146,13 +142,21 @@ export const CollectionNotAllowViewPlaceholder: FC<any> = () => {
},
).replaceAll('&gt;', '>');
}, [nameValue, t]);
return (
<BlockItemCard>
<Result status="404" subTitle={messageValue} />
</BlockItemCard>
);
};
/**
* @internal
*/
export const CollectionNotAllowViewPlaceholder: FC<any> = () => {
const { designable } = useDesignable();
if (designable) {
return (
<BlockItemCard>
<Result status="404" subTitle={messageValue} />
</BlockItemCard>
);
return <CollectionNotAllowView />;
}
return null;