1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-22 22:15:17 -04:00

Improve typings in FormInputGroup

(cherry picked from commit 6838f068bcd04b770cd9c53873f160be97ea745f)
This commit is contained in:
Mark McDowall
2025-01-03 09:47:17 -08:00
committed by Bogdan
parent 8fb2f64e98
commit 2c81f3be0f
43 changed files with 321 additions and 301 deletions
+2 -3
View File
@@ -11,7 +11,7 @@ interface ChangeEvent<T = Element> extends SyntheticEvent<T, MouseEvent> {
target: EventTarget & T;
}
interface CheckInputProps {
export interface CheckInputProps {
className?: string;
containerClassName?: string;
name: string;
@@ -45,7 +45,6 @@ function CheckInput(props: CheckInputProps) {
const isChecked = value === checkedValue;
const isUnchecked = value === uncheckedValue;
const isIndeterminate = !isChecked && !isUnchecked;
const isCheckClass: keyof typeof styles = `${kind}IsChecked`;
const toggleChecked = useCallback(
(checked: boolean, shiftKey: boolean) => {
@@ -112,7 +111,7 @@ function CheckInput(props: CheckInputProps) {
<div
className={classNames(
className,
isChecked ? styles[isCheckClass] : styles.isNotChecked,
isChecked ? styles[kind] : styles.isNotChecked,
isIndeterminate && styles.isIndeterminate,
isDisabled && styles.isDisabled
)}