mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Migrate AIDebugButton component to TypeScript. (#3286)
* Migrate `AIDebugButton` component to TypeScript. * Reorder keys * Update to use vision camera's own type --------- Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
This commit is contained in:
@@ -13,15 +13,29 @@ import {
|
||||
Modal,
|
||||
Portal
|
||||
} from "react-native-paper";
|
||||
import type { CameraDeviceFormat } from "react-native-vision-camera";
|
||||
import { useDebugMode } from "sharedHooks";
|
||||
import colors from "styles/tailwindColors";
|
||||
|
||||
import SliderControl from "./SliderControl";
|
||||
|
||||
interface Props {
|
||||
debugFormat: CameraDeviceFormat | null;
|
||||
changeDebugFormat: () => void;
|
||||
confidenceThreshold: number;
|
||||
setConfidenceThreshold: ( value: number ) => void;
|
||||
fps: number;
|
||||
setFPS: ( value: number ) => void;
|
||||
numStoredResults: number;
|
||||
setNumStoredResults: ( value: number ) => void;
|
||||
cropRatio: number;
|
||||
setCropRatio: ( value: number ) => void;
|
||||
}
|
||||
|
||||
const AIDebugButton = ( {
|
||||
debugFormat,
|
||||
changeDebugFormat,
|
||||
confidenceThreshold,
|
||||
debugFormat,
|
||||
setConfidenceThreshold,
|
||||
fps,
|
||||
setFPS,
|
||||
@@ -29,7 +43,7 @@ const AIDebugButton = ( {
|
||||
setNumStoredResults,
|
||||
cropRatio,
|
||||
setCropRatio
|
||||
} ) => {
|
||||
}: Props ) => {
|
||||
const [modalVisible, setModalVisible] = useState( false );
|
||||
const [slideIndex, setSlideIndex] = useState( 0 );
|
||||
const { isDebug } = useDebugMode( );
|
||||
Reference in New Issue
Block a user