mirror of
https://github.com/chrisbenincasa/tunarr.git
synced 2026-04-18 09:03:35 -04:00
Allows for better loudness normalization vs straight volume adjustment using the ffmpeg loudnorm filter. The i, lra, and tp values are all configurable in the advanced transcode settings.
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import type { FormControlProps, FormHelperTextProps } from '@mui/material';
|
|
import {
|
|
Checkbox,
|
|
FormControl,
|
|
FormControlLabel,
|
|
FormHelperText,
|
|
} from '@mui/material';
|
|
import { isNil } from 'lodash-es';
|
|
import type { ReactNode } from 'react';
|
|
import { useFieldContext } from '../../hooks/form.ts';
|
|
|
|
type Props = {
|
|
label: string;
|
|
formControlProps?: FormControlProps;
|
|
helperText?: ReactNode;
|
|
formHelperTextProps?: FormHelperTextProps;
|
|
};
|
|
|
|
export function BasicCheckboxInput({
|
|
formControlProps,
|
|
formHelperTextProps,
|
|
helperText,
|
|
label,
|
|
}: Props) {
|
|
const field = useFieldContext<boolean>();
|
|
return (
|
|
<FormControl {...formControlProps}>
|
|
<FormControlLabel
|
|
control={
|
|
<Checkbox
|
|
value={field.state.value}
|
|
checked={field.state.value}
|
|
onChange={(_, checked) => field.handleChange(checked)}
|
|
/>
|
|
}
|
|
label={label}
|
|
/>
|
|
{!isNil(helperText) && (
|
|
<FormHelperText {...formHelperTextProps}>{helperText}</FormHelperText>
|
|
)}
|
|
</FormControl>
|
|
);
|
|
}
|