import React, { PropsWithChildren } from 'react'; import { StyleSheet, View, ViewStyle } from 'react-native'; import { ComponentStyleProp, LLComponentStyleFn } from '../../types'; import { useStyles } from '../../hooks'; export type LLChatMessageMenuStyles = { menuContainer: ViewStyle; }; export type LLChatMessageMenuProps = ComponentStyleProp & PropsWithChildren<{ visible: boolean; }>; export function LLChatMessageMenu({ visible, styles: stylesProp, children, }: LLChatMessageMenuProps) { const menuStyles = useStyles({ componentStylesFn: getChatMessageMenuStyles, stylesProp, }); if (!visible) { return null; } return {children}; } const getChatMessageMenuStyles: LLComponentStyleFn = ({ theme, }) => StyleSheet.create({ menuContainer: { position: 'absolute', top: 5, right: 5, flexDirection: 'column', paddingHorizontal: 10, backgroundColor: theme.popoverBackground, borderRadius: 8, }, });