import { BottomTabHeaderProps } from '@react-navigation/bottom-tabs'
import { getHeaderTitle } from '@react-navigation/elements'
import React from 'react'
import {
Appbar,
AppbarProps,
IconButton,
Searchbar,
SearchbarProps,
Tooltip,
} from 'react-native-paper'
interface TabsHeaderProps extends AppbarProps {
navProps: BottomTabHeaderProps
withSearchBar?: boolean
searchBarProps?: SearchbarProps
}
const TabsHeader = (props: TabsHeaderProps) => {
const [query, setQuery] = React.useState('')
return props.withSearchBar ? (
(
props.searchBarProps?.onChangeText
? props.searchBarProps.onChangeText(query)
: undefined
}
/>
)}
/>
) : (
{props.navProps.options.headerLeft
? props.navProps.options.headerLeft({})
: undefined}
{props.navProps.options.headerRight
? props.navProps.options.headerRight({
canGoBack: props.navProps.navigation.canGoBack(),
})
: undefined}
)
}
export default TabsHeader