({ text })
| 14 | } |
| 15 | |
| 16 | export const UserMessage: React.FC<UserMessageProps> = ({ text }) => { |
| 17 | const prefix = '> '; |
| 18 | const prefixWidth = prefix.length; |
| 19 | const isSlashCommand = text.startsWith('/'); |
| 20 | |
| 21 | const textColor = isSlashCommand ? Colors.AccentPurple : Colors.Gray; |
| 22 | const borderColor = isSlashCommand ? Colors.AccentPurple : Colors.Gray; |
| 23 | |
| 24 | return ( |
| 25 | <Box |
| 26 | borderStyle="round" |
| 27 | borderColor={borderColor} |
| 28 | flexDirection="row" |
| 29 | paddingX={2} |
| 30 | paddingY={0} |
| 31 | marginY={1} |
| 32 | alignSelf="flex-start" |
| 33 | > |
| 34 | <Box width={prefixWidth}> |
| 35 | <Text color={textColor}>{prefix}</Text> |
| 36 | </Box> |
| 37 | <Box flexGrow={1}> |
| 38 | <Text wrap="wrap" color={textColor}> |
| 39 | {text} |
| 40 | </Text> |
| 41 | </Box> |
| 42 | </Box> |
| 43 | ); |
| 44 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected