import React from 'react'; import { StyleSheet, StyleProp, ViewStyle } from 'react-native'; import Animated, { interpolateColor, SharedValue, useAnimatedStyle } from 'react-native-reanimated'; interface HeaderBottomBorderProps { /** * Animated value that controls the opacity of the bottom border. * * @type {SharedValue} */ opacity: SharedValue; /** * Style of the bottom border component. */ style?: StyleProp; /** * */ initialBorderColor?: string; /** * Color of the bottom border. * * @default '#E5E5E5' */ borderColor?: string; /** * Width of the bottom border. * * @default 1 */ borderWidth?: number; } const HeaderBottomBorder: React.FC = ({ opacity, style, initialBorderColor = '#E5E5E5', borderColor = '#E5E5E5', borderWidth = 1, }) => { const borderBottomStyle = useAnimatedStyle( () => ({ backgroundColor: interpolateColor(opacity.value, [0, 1], [initialBorderColor, borderColor]), }), [initialBorderColor, borderColor] ); return ; }; export default HeaderBottomBorder; const styles = StyleSheet.create({ line: { width: '100%' } });