Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

Commit

Permalink
Introduced patternfly empty state for Baremetal inventory
Browse files Browse the repository at this point in the history
Implemented HostsEmptyState component for Baremetal inventory.
  • Loading branch information
betherly committed Feb 21, 2019
1 parent 5f5b6db commit 6990920
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
26 changes: 26 additions & 0 deletions src/components/HostsEmptyState.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import {
Title,
EmptyState,
EmptyStateBody,
Bullseye
} from '@patternfly/react-core';

class HostsEmptyState extends React.Component {
render(): JSX.Element {
return (
<Bullseye>
<EmptyState>
<Title size="lg">No hosts connected</Title>
<EmptyStateBody>
Connect at least 3 hosts to your cluster to pool
<br />
together resources and start running workloads.
</EmptyStateBody>
</EmptyState>
</Bullseye>
);
}
}

export default HostsEmptyState;
4 changes: 3 additions & 1 deletion src/components/HostsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { FC, Fragment } from 'react';
import { Table, TableHeader, TableBody } from '@patternfly/react-table';
import { Bullseye } from '@patternfly/react-core';
import { HostTableRows } from '../models/hosts';
import { HostsEmptyState } from './HostsEmptyState';

interface Props {
hostRows: HostTableRows;
Expand Down Expand Up @@ -42,9 +43,10 @@ const HostsTable: FC<Props> = ({
<Fragment>
<Table rows={hostRows} cells={columns} aria-label="Hosts table">
<TableHeader />
{!loadingHosts && <TableBody />}
{!loadingHosts && !!hostRows.length && <TableBody />}
</Table>
{loadingHosts && <Bullseye>Loading...</Bullseye>}
{!loadingHosts && !hostRows.length && <HostsEmptyState />}
</Fragment>
);
};
Expand Down

0 comments on commit 6990920

Please sign in to comment.