mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
33 lines
881 B
TypeScript
33 lines
881 B
TypeScript
import React, { SFC } from 'react';
|
|
import classNames from 'classnames/bind';
|
|
import PluginListItem from './PluginListItem';
|
|
import { Plugin } from 'app/types';
|
|
import { LayoutMode, LayoutModes } from '../../core/components/LayoutSelector/LayoutSelector';
|
|
|
|
interface Props {
|
|
plugins: Plugin[];
|
|
layoutMode: LayoutMode;
|
|
}
|
|
|
|
const PluginList: SFC<Props> = props => {
|
|
const { plugins, layoutMode } = props;
|
|
|
|
const listStyle = classNames({
|
|
'card-section': true,
|
|
'card-list-layout-grid': layoutMode === LayoutModes.Grid,
|
|
'card-list-layout-list': layoutMode === LayoutModes.List,
|
|
});
|
|
|
|
return (
|
|
<section className={listStyle}>
|
|
<ol className="card-list">
|
|
{plugins.map((plugin, index) => {
|
|
return <PluginListItem plugin={plugin} key={`${plugin.name}-${index}`} />;
|
|
})}
|
|
</ol>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
export default PluginList;
|