forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {View} from 'react-native'
2
3import {MAX_ALT_TEXT} from '#/lib/constants'
4import {CharProgress} from '#/view/com/composer/char-progress/CharProgress'
5import {atoms as a, useTheme} from '#/alf'
6
7export function AltTextCounterWrapper({
8 altText,
9 children,
10}: {
11 altText?: string
12 children: React.ReactNode
13}) {
14 const t = useTheme()
15 return (
16 <View style={[a.flex_row]}>
17 <CharProgress
18 style={[
19 a.flex_col_reverse,
20 a.align_center,
21 a.mr_xs,
22 {minWidth: 50, gap: 1},
23 ]}
24 textStyle={[{marginRight: 0}, a.text_sm, t.atoms.text_contrast_medium]}
25 size={26}
26 count={altText?.length || 0}
27 max={MAX_ALT_TEXT}
28 />
29 {children}
30 </View>
31 )
32}