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

Improve typings in FormInputGroup

This commit is contained in:
Mark McDowall
2025-01-03 09:47:17 -08:00
parent b218461678
commit 6838f068bc
44 changed files with 321 additions and 281 deletions
@@ -24,16 +24,16 @@ export interface RootFolderSelectInputValue
isMissing?: boolean;
}
interface RootFolderSelectInputProps
export interface RootFolderSelectInputProps
extends Omit<
EnhancedSelectInputProps<EnhancedSelectInputValue<string>, string>,
'value' | 'values'
> {
name: string;
value?: string;
isSaving: boolean;
saveError?: object;
includeNoChange: boolean;
includeMissingValue?: boolean;
includeNoChange?: boolean;
includeNoChangeDisabled?: boolean;
}
function createRootFolderOptionsSelector(
@@ -107,13 +107,20 @@ function createRootFolderOptionsSelector(
function RootFolderSelectInput({
name,
value,
includeMissingValue = true,
includeNoChange = false,
includeNoChangeDisabled = true,
onChange,
...otherProps
}: RootFolderSelectInputProps) {
const dispatch = useDispatch();
const { values, isSaving, saveError } = useSelector(
createRootFolderOptionsSelector(value, true, includeNoChange, false)
createRootFolderOptionsSelector(
value,
includeMissingValue,
includeNoChange,
includeNoChangeDisabled
)
);
const [isAddNewRootFolderModalOpen, setIsAddNewRootFolderModalOpen] =
useState(false);