import { Text, View } from "react-native-ui-lib"; import React from "react"; import { ProgressBar } from "react-native-ui-lib/src/components/progressBar"; import FireworksOrangeIcon from "@/assets/svgs/FireworksOrangeIcon"; import { useAuthContext } from "@/contexts/AuthContext"; export const transformNumber = (value: number, progressLimit: number) => { return Math.floor((value / progressLimit) * 100); } const PROGRESS_LIMIT = 1000; const ProgressCard = ({children}: { children?: React.ReactNode }) => { const { profileData } = useAuthContext(); const weeklyPoints = profileData?.weeklyPoints ?? 0; const transformedWeeklyPoints = transformNumber(weeklyPoints, PROGRESS_LIMIT); return ( You have earned {weeklyPoints} points this week!{" "} 0 {PROGRESS_LIMIT} {children} ); }; export default ProgressCard;