feat(react): add empty state UI for browse when no entities (#2370)

This commit is contained in:
Brian 2021-04-09 04:41:12 +08:00 committed by GitHub
parent fd0923c445
commit 4a47abf605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import React from 'react';
import styled from 'styled-components';
import { Col, Divider, List, Pagination, Row } from 'antd';
import { Col, Divider, List, Pagination, Row, Empty } from 'antd';
import { Content } from 'antd/lib/layout/layout';
import { BrowseResultGroup, EntityType, Entity } from '../../types.generated';
import BrowseResultCard from './BrowseResultCard';
@ -58,7 +58,7 @@ export const BrowseResults = ({
/>
</Col>
))}
{entities.length > 0 && (
{(!(groups && groups.length > 0) || (entities && entities.length > 0)) && (
<EntityList
dataSource={entities}
split={false}
@ -69,6 +69,7 @@ export const BrowseResults = ({
</>
)}
bordered
locale={{ emptyText: <Empty description="No Entities" /> }}
/>
)}
<Col span={24}>