Skip to content

Commit

Permalink
feat: empty visualize view
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymond Ottun committed Oct 9, 2021
1 parent 61470cd commit e188879
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions ui/src/components/Visualise.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, Button, Col, Modal, Row, Space } from 'antd';
import { Alert, Button, Col, Modal, Row, Space, Empty } from 'antd';
import Checkbox from 'antd/lib/checkbox/Checkbox';
import mermaid from 'mermaid';
import { useEffect, useState } from 'react';
Expand Down Expand Up @@ -127,25 +127,37 @@ export const Visualise = () => {
title="Visualizations"
footer={[]}
>
{state.warn && (
<Alert type="warning" message={`Only a maximum of ${MAX_RECORDS} are rendered`} showIcon />
)}
<Space direction="vertical" style={{ width: '100%' }}>
<Row justify="center" style={{ width: '100%' }}>
<Col>
<Checkbox onChange={switchByUrl} checked={state.byUrl}>
Path based services
</Checkbox>
</Col>
<Col>
<Checkbox onChange={switchProxy} checked={state.withProxy} style={{ display: 'none' }}>
Show proxy
</Checkbox>
</Col>
</Row>

{state.warn && (
<Alert type="warning" message={`Only a maximum of ${MAX_RECORDS} are rendered`} showIcon />
{records.length === 0 && (
<>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="Records" />
</>
)}

{state.code && <Diagram code={state.code} />}
{records.length !== 0 && (
<>
<Row justify="center" style={{ width: '100%' }}>
<Col>
<Checkbox onChange={switchByUrl} checked={state.byUrl}>
Path based services
</Checkbox>
</Col>
<Col>
<Checkbox
onChange={switchProxy}
checked={state.withProxy}
style={{ display: 'none' }}
>
Show proxy
</Checkbox>
</Col>
</Row>
{state.code && <Diagram code={state.code} />}
</>
)}
</Space>
</Modal>
</div>
Expand Down

0 comments on commit e188879

Please sign in to comment.