diff --git a/suite-native/module-trading/src/components/general/PickerHeader.tsx b/suite-native/module-trading/src/components/general/PickerHeader.tsx
index 369d3b6eb72..bfd2ca6ef14 100644
--- a/suite-native/module-trading/src/components/general/PickerHeader.tsx
+++ b/suite-native/module-trading/src/components/general/PickerHeader.tsx
@@ -2,34 +2,40 @@ import { ReactNode } from 'react';
import { HStack, SearchInput, Text, VStack } from '@suite-native/atoms';
+type PickerHeaderSearchInputProps = {
+ onSearchInputChange: (value: string) => void;
+ searchInputPlaceholder?: string;
+ isSearchInputDisabled?: boolean;
+ maxSearchInputLength?: number;
+};
+
export type PickerHeaderProps = {
title: ReactNode;
children?: ReactNode;
} & (
- | {
- isSearchInputVisible?: false;
- onSearchInputChange?: never;
- searchInputPlaceholder?: never;
- isSearchInputDisabled?: never;
- maxSearchInputLength?: never;
- }
- | {
- isSearchInputVisible: true;
- onSearchInputChange: (value: string) => void;
- searchInputPlaceholder?: string;
- isSearchInputDisabled?: boolean;
- maxSearchInputLength?: number;
- }
+ | { isSearchInputVisible?: false }
+ | ({ isSearchInputVisible: true } & PickerHeaderSearchInputProps)
+);
+
+const PickerHeaderSearchInput = ({
+ onSearchInputChange,
+ searchInputPlaceholder,
+ isSearchInputDisabled,
+ maxSearchInputLength,
+}: PickerHeaderSearchInputProps) => (
+
);
export const PickerHeader = ({
title,
isSearchInputVisible,
children,
- maxSearchInputLength,
- searchInputPlaceholder,
- isSearchInputDisabled,
- onSearchInputChange,
+ ...searchInputProps
}: PickerHeaderProps) => (
@@ -39,12 +45,7 @@ export const PickerHeader = ({
{children}
{isSearchInputVisible && (
-
+
)}
);