import React from 'react'; import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native'; import rpx from '@/utils/rpx'; import {TouchableOpacity} from 'react-native-gesture-handler'; import ThemeText from '@/components/base/themeText'; import Divider from '@/components/base/divider'; interface IPanelHeaderProps { title: string; cancelText?: string; okText?: string; onCancel?: () => void; onOk?: () => void; hideButtons?: boolean; hideDivider?: boolean; style?: StyleProp; } export default function PanelHeader(props: IPanelHeaderProps) { const { title, cancelText, okText, onOk, onCancel, hideButtons, hideDivider, style, } = props; return ( <> {hideButtons ? null : ( {cancelText || '取消'} )} {title} {hideButtons ? null : ( {okText || '确认'} )} {hideDivider ? null : } ); } const styles = StyleSheet.create({ header: { width: '100%', flexDirection: 'row', alignItems: 'center', paddingHorizontal: rpx(24), height: rpx(100), }, button: { width: rpx(120), height: '100%', justifyContent: 'center', }, rightButton: { alignItems: 'flex-end', }, title: { flex: 1, textAlign: 'center', }, });