2019-01-17 02:27:43 -06:00
|
|
|
import React, { FC } from 'react';
|
2019-04-29 11:14:39 -05:00
|
|
|
import { PluginMeta } from '@grafana/ui';
|
2018-09-27 05:15:41 -05:00
|
|
|
|
|
|
|
interface Props {
|
2019-04-29 11:14:39 -05:00
|
|
|
plugin: PluginMeta;
|
2018-09-27 05:15:41 -05:00
|
|
|
}
|
|
|
|
|
2019-01-17 02:27:43 -06:00
|
|
|
const PluginListItem: FC<Props> = props => {
|
2018-09-27 05:15:41 -05:00
|
|
|
const { plugin } = props;
|
2019-04-17 08:18:32 -05:00
|
|
|
let icon;
|
|
|
|
|
|
|
|
if (plugin.type === 'datasource') {
|
|
|
|
icon = 'gicon gicon-datasources';
|
|
|
|
} else if (plugin.type === 'panel') {
|
|
|
|
icon = 'icon-gf icon-gf-panel';
|
|
|
|
} else {
|
|
|
|
icon = 'icon-gf icon-gf-apps';
|
|
|
|
}
|
2018-09-25 07:53:55 -05:00
|
|
|
|
|
|
|
return (
|
|
|
|
<li className="card-item-wrapper">
|
|
|
|
<a className="card-item" href={`plugins/${plugin.id}/edit`}>
|
|
|
|
<div className="card-item-header">
|
|
|
|
<div className="card-item-type">
|
2019-04-17 08:18:32 -05:00
|
|
|
<i className={icon} />
|
2018-09-25 07:53:55 -05:00
|
|
|
{plugin.type}
|
|
|
|
</div>
|
|
|
|
{plugin.hasUpdate && (
|
|
|
|
<div className="card-item-notice">
|
|
|
|
<span bs-tooltip="plugin.latestVersion">Update available!</span>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
<div className="card-item-body">
|
|
|
|
<figure className="card-item-figure">
|
|
|
|
<img src={plugin.info.logos.small} />
|
|
|
|
</figure>
|
|
|
|
<div className="card-item-details">
|
|
|
|
<div className="card-item-name">{plugin.name}</div>
|
|
|
|
<div className="card-item-sub-name">{`By ${plugin.info.author.name}`}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
);
|
2018-09-27 05:15:41 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
export default PluginListItem;
|