import React from 'react'; import { Pressable, ViewStyle, StyleSheet, ActivityIndicator, Image, ImageStyle, } from 'react-native'; import { useStyles, useTheme } from '../../hooks'; import { ComponentStyleProp, LLComponentStyleFn } from '../../types'; export type LLComposerSendButtonStyles = { buttonContainer: ViewStyle; icon: ImageStyle; }; export type LLComposerSendButtonProps = ComponentStyleProp & { onPress: () => void; isSendingMessage: boolean; disabled?: boolean; }; export function LLComposerSendButton({ onPress, disabled, styles: stylesProp, isSendingMessage, }: LLComposerSendButtonProps) { const { themeAssets } = useTheme(); const composerButtonStyles = useStyles({ componentStylesFn: getComposerButtonStyles({ disabled }), stylesProp, }); return ( {isSendingMessage ? ( ) : ( )} ); } const getComposerButtonStyles: ( props: Pick ) => LLComponentStyleFn = (props) => ({ theme }) => StyleSheet.create({ buttonContainer: { height: 45, width: 45, display: 'flex', alignItems: 'center', justifyContent: 'center', borderRadius: 10, marginLeft: 5, backgroundColor: theme.primaryButtonBackground, opacity: props.disabled ? 0.5 : 1, }, icon: { height: 18, width: 18, }, });