1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/src/component/application/application-list-component.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-12-03 15:54:15 +01:00
import React, { Component } from 'react';
2016-12-09 14:02:36 +01:00
import { List, ListItem, ListItemContent } from 'react-mdl';
2016-12-05 15:15:01 +01:00
import { Link } from 'react-router';
2016-12-03 15:54:15 +01:00
class ClientStrategies extends Component {
componentDidMount () {
2016-12-05 15:15:01 +01:00
this.props.fetchAll();
2016-12-03 15:54:15 +01:00
}
render () {
2016-12-05 15:15:01 +01:00
const {
applications,
} = this.props;
2016-12-03 15:54:15 +01:00
2016-12-05 15:15:01 +01:00
if (!applications) {
return <div>loading...</div>;
}
2016-12-03 15:54:15 +01:00
return (
<div>
2016-12-09 14:02:36 +01:00
<h5>Applications</h5>
<hr />
<List>
{applications.map(({ appName, data = {} }) => (
<ListItem key={appName} twoLine>
<ListItemContent avatar={data.icon || 'apps'} subtitle={data.description}>
<Link to={`/applications/${appName}`}>
{appName}
</Link>
</ListItemContent>
</ListItem>
2016-12-05 15:15:01 +01:00
))}
2016-12-09 14:02:36 +01:00
</List>
2016-12-03 15:54:15 +01:00
</div>
);
}
}
export default ClientStrategies;