(props: Props)
| 15 | +color: string, |
| 16 | }; |
| 17 | function ThreadVisibility(props: Props): React.Node { |
| 18 | const { threadType, color } = props; |
| 19 | const label = threadLabel(threadType); |
| 20 | |
| 21 | const iconColor = React.useMemo( |
| 22 | () => (tinycolor(color).isDark() ? 'white' : 'black'), |
| 23 | [color], |
| 24 | ); |
| 25 | |
| 26 | const icon = React.useMemo( |
| 27 | () => <ThreadIcon threadType={threadType} color={iconColor} />, |
| 28 | [iconColor, threadType], |
| 29 | ); |
| 30 | |
| 31 | return ( |
| 32 | <View style={styles.container}> |
| 33 | <Pill icon={icon} label={label} backgroundColor={color} /> |
| 34 | </View> |
| 35 | ); |
| 36 | } |
| 37 | |
| 38 | const styles = StyleSheet.create({ |
| 39 | container: { |
nothing calls this directly
no test coverage detected