1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

Convert Table to TypeScript

This commit is contained in:
Mark McDowall
2025-01-06 16:48:33 -08:00
parent d8a147d234
commit 0b58278e15
57 changed files with 959 additions and 1239 deletions
@@ -0,0 +1,43 @@
import React, { useMemo } from 'react';
import CheckInput from 'Components/Form/CheckInput';
import { CheckInputChanged } from 'typings/inputs';
import VirtualTableHeaderCell from './TableHeaderCell';
import styles from './TableSelectAllHeaderCell.css';
interface TableSelectAllHeaderCellProps {
allSelected: boolean;
allUnselected: boolean;
onSelectAllChange: (change: CheckInputChanged) => void;
}
function TableSelectAllHeaderCell({
allSelected,
allUnselected,
onSelectAllChange,
}: TableSelectAllHeaderCellProps) {
const value = useMemo(() => {
if (allSelected) {
return true;
} else if (allUnselected) {
return false;
}
return null;
}, [allSelected, allUnselected]);
return (
<VirtualTableHeaderCell
className={styles.selectAllHeaderCell}
name="selectAll"
>
<CheckInput
className={styles.input}
name="selectAll"
value={value}
onChange={onSelectAllChange}
/>
</VirtualTableHeaderCell>
);
}
export default TableSelectAllHeaderCell;