import React from 'react' import { StyleSheet, Text, View } from 'react-native' import { Feather } from '@expo/vector-icons' import Emojis from './Emojis' import { useTheme } from 'src/utils/styles/ThemeManager' import constants from 'src/utils/styles/constants' export interface Props { action: 'favourite' | 'follow' | 'mention' | 'poll' | 'reblog' name?: string emojis?: Mastodon.Emoji[] notification?: boolean } const Actioned: React.FC = ({ action, name, emojis, notification = false }) => { const { theme } = useTheme() const iconColor = theme.primary let icon let content switch (action) { case 'favourite': icon = ( ) content = `${name} 喜欢了你的嘟嘟` break case 'follow': icon = ( ) content = `${name} 开始关注你` break case 'poll': icon = ( ) content = `你参与的投票已结束` break case 'reblog': icon = ( ) content = `${name} 转嘟了${notification ? '你的嘟嘟' : ''}` break } return ( {icon} {content ? ( {emojis ? ( ) : ( {content} )} ) : ( <> )} ) } const styles = StyleSheet.create({ actioned: { flexDirection: 'row', marginBottom: constants.SPACING_S }, icon: { marginLeft: constants.AVATAR_S - constants.FONT_SIZE_S, marginRight: constants.SPACING_S }, content: { flexDirection: 'row' } }) export default Actioned