Group Clops Feature Branch (#10360)
Co-authored-by: DS Boyce <260543580+ds-boyce@users.noreply.github.com> Co-authored-by: Samuel Newman <mozzius@protonmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
Samuel Newman
parent
a975606188
commit
f37a163814
@@ -0,0 +1,44 @@
|
||||
import {Pressable, type StyleProp, View, type ViewStyle} from 'react-native'
|
||||
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {type TriggerChildProps} from '#/components/Menu/types'
|
||||
import {Text} from '#/components/Typography'
|
||||
|
||||
export function StatusBadge({
|
||||
label,
|
||||
style,
|
||||
pressableProps,
|
||||
}: {
|
||||
label: string
|
||||
style?: StyleProp<ViewStyle>
|
||||
pressableProps?: TriggerChildProps['props']
|
||||
}) {
|
||||
const t = useTheme()
|
||||
|
||||
const badgeStyle = [
|
||||
a.rounded_xs,
|
||||
t.atoms.bg_contrast_50,
|
||||
{
|
||||
paddingTop: 3,
|
||||
paddingBottom: 3,
|
||||
paddingLeft: 6,
|
||||
paddingRight: 6,
|
||||
},
|
||||
style,
|
||||
]
|
||||
|
||||
const labelText = (
|
||||
<Text style={[a.text_sm, a.font_semi_bold, t.atoms.text_contrast_medium]}>
|
||||
{label}
|
||||
</Text>
|
||||
)
|
||||
|
||||
if (pressableProps) {
|
||||
return (
|
||||
<Pressable style={badgeStyle} {...pressableProps}>
|
||||
{labelText}
|
||||
</Pressable>
|
||||
)
|
||||
}
|
||||
return <View style={badgeStyle}>{labelText}</View>
|
||||
}
|
||||
Reference in New Issue
Block a user