import { useMemo, type ReactNode } from 'react' import { View, type StyleProp, type ViewProps, type ViewStyle } from 'react-native' import { useTheme } from '../../global-contexts/theme/ThemeContext' import { ThemedText } from '../visualization-and-display/ThemedText' import type { ChatDateDividerStyle, ChatDateDividerTextStyle } from '../../theme/types/components/chat' import type { StyleOverwrite } from '../../theme/types/resolver' export type ChatDateDividerProps = Omit & { children?: ReactNode, style?: StyleProp, dividerStyle?: StyleOverwrite, ChatDateDividerStyle>, textStyle?: StyleOverwrite, ChatDateDividerTextStyle>, } export const ChatDateDivider = ({ children, style, dividerStyle, textStyle, ...props }: ChatDateDividerProps) => { const { theme } = useTheme() const state = useMemo(() => ({}), []) const resolvedDividerStyle = useMemo( () => theme.components.chat.dateDivider.container(state, dividerStyle), [theme, state, dividerStyle] ) const resolvedTextStyle = useMemo( () => theme.components.chat.dateDivider.text(state, textStyle), [theme, state, textStyle] ) return ( {typeof children === 'string' || typeof children === 'number' ? ( {children} ) : ( children )} ) }