The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/playlist/PlaylistTableRows.tsx

43 lines
1.0 KiB

import React, { FC } from 'react';
import { PlaylistTableRow } from './PlaylistTableRow';
import { PlaylistItem } from './types';
interface PlaylistTableRowsProps {
items: PlaylistItem[];
onMoveUp: (item: PlaylistItem) => void;
onMoveDown: (item: PlaylistItem) => void;
onDelete: (item: PlaylistItem) => void;
}
export const PlaylistTableRows: FC<PlaylistTableRowsProps> = ({ items, onMoveUp, onMoveDown, onDelete }) => {
if (items.length === 0) {
return (
<tr>
<td>
<em>Playlist is empty. Add dashboards below.</em>
</td>
</tr>
);
}
return (
<>
{items.map((item, index) => {
const first = index === 0;
const last = index === items.length - 1;
return (
<PlaylistTableRow
first={first}
last={last}
item={item}
onDelete={onDelete}
onMoveDown={onMoveDown}
onMoveUp={onMoveUp}
key={item.title}
/>
);
})}
</>
);
};