mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import React from 'react'
2import {View} from 'react-native'
3import * as Progress from 'react-native-progress'
4
5import {atoms as a, useTheme} from '#/alf'
6import {AnimatedCheck} from '../anim/AnimatedCheck'
7import {Text} from '../Typography'
8
9export function ProgressGuideTask({
10 current,
11 total,
12 title,
13 subtitle,
14}: {
15 current: number
16 total: number
17 title: string
18 subtitle?: string
19}) {
20 const t = useTheme()
21
22 return (
23 <View style={[a.flex_row, a.gap_sm, !subtitle && a.align_center]}>
24 {current === total ? (
25 <AnimatedCheck playOnMount fill={t.palette.primary_500} width={20} />
26 ) : (
27 <Progress.Circle
28 progress={current / total}
29 color={t.palette.primary_400}
30 size={20}
31 thickness={3}
32 borderWidth={0}
33 unfilledColor={t.palette.contrast_50}
34 />
35 )}
36
37 <View style={[a.flex_col, a.gap_2xs, {marginTop: -2}]}>
38 <Text style={[a.text_sm, a.font_semibold, a.leading_tight]}>
39 {title}
40 </Text>
41 {subtitle && (
42 <Text
43 style={[a.text_sm, t.atoms.text_contrast_medium, a.leading_tight]}>
44 {subtitle}
45 </Text>
46 )}
47 </View>
48 </View>
49 )
50}