grafana/public/app/features/playlist/PlaylistTableRows.tsx
Diana Payton 1399b49c16
UI text edits (#32524)
* Update TeamSettings.tsx

* Update navModel.ts

* Update ChangePasswordForm.tsx

* Update UserProfileEditForm.tsx

* Update DashboardImportPage.tsx

* Update uploadDashboardDirective.ts

* Update ImportDashboardForm.tsx

* Update ImportDashboardOverview.tsx

* Update validation.ts

* Update PlaylistEditPage.tsx

* ui text edits

* text edits

* Update buildCategories.ts

* text edits

* text edits

* Fix formatting

* Update test snapshots

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
2021-03-31 16:07:37 -07:00

44 lines
1.0 KiB
TypeScript

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}
/>
);
})}
</>
);
};