import { View, Text } from "react-native"; import tw from "twrnc"; import { formatPercentage } from "../../../lib/helper/format"; interface ProgressBarProps { label: string; value: number; max: number; formatFn?: (input: number) => string; } export default function ProgressBar({ label, value, max, formatFn, }: ProgressBarProps) { const percentage = formatPercentage(value / max); return ( {label} ({percentage}) {formatFn && ( {formatFn(value)}/{formatFn(max)} )} ); }