1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -04:00

Convert ImportListList component to TypeScript

This commit is contained in:
Bogdan
2025-04-27 19:20:02 +03:00
parent 371ac0921d
commit 9228e5dea0
5 changed files with 39 additions and 64 deletions
@@ -0,0 +1,35 @@
import React from 'react';
import { useSelector } from 'react-redux';
import AppState from 'App/State/AppState';
import Label from './Label';
import styles from './ImportListList.css';
interface ImportListListProps {
lists: number[];
}
function ImportListList({ lists }: ImportListListProps) {
const allImportLists = useSelector(
(state: AppState) => state.settings.importLists.items
);
return (
<div className={styles.lists}>
{lists.map((id) => {
const importList = allImportLists.find((list) => list.id === id);
if (!importList) {
return null;
}
return (
<Label key={importList.id} kind="success" size="medium">
{importList.name}
</Label>
);
})}
</div>
);
}
export default ImportListList;