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