Add empty state

pull/10616/head
Alex P 2017-05-23 12:13:11 -07:00
parent ea0766a21a
commit 89eee35126
1 changed files with 46 additions and 41 deletions

View File

@ -108,8 +108,6 @@ const HostsTable = React.createClass({
hostsTitle = 'Loading Hosts...'
} else if (hostsError.length) {
hostsTitle = 'There was a problem loading hosts'
} else if (hosts.length === 0) {
hostsTitle = 'No hosts found'
} else if (hostCount === 1) {
hostsTitle = `${hostCount} Host`
} else {
@ -123,7 +121,8 @@ const HostsTable = React.createClass({
<SearchBar onSearch={this.updateSearchTerm} />
</div>
<div className="panel-body">
<table className="table v-center">
{hostCount > 0 && !hostsError.length
? <table className="table v-center table-highlight">
<thead>
<tr>
<th
@ -156,12 +155,18 @@ const HostsTable = React.createClass({
<th>Apps</th>
</tr>
</thead>
<tbody>
{sortedHosts.map(h => {
return <HostRow key={h.name} host={h} source={source} />
})}
</tbody>
</table>
: <div className="generic-empty-state">
<h4 style={{margin: '90px 0'}}>
No Hosts found
</h4>
</div>}
</div>
</div>
)