/* eslint-disable import/no-deprecated -- This file implements the deprecated * ProgressBar component; self-references predate the deprecation. Migrate to * ProgressIndicator. */ import React from "react"; import { View } from "react-native"; import type { ProgressBarProps } from "./types"; import { useStyles } from "./ProgressBar.style"; import { ProgressBarInner, calculateWidth } from "./ProgressBarInner"; import { ProgressBarStepped } from "./ProgressBarStepped"; import { sizeStyles } from "./ProgressBar.size.style"; import { useAtlantisI18n } from "../hooks/useAtlantisI18n"; import { useAtlantisTheme } from "../AtlantisThemeContext"; /** * @deprecated Use `ProgressIndicator` from `@jobber/components-native` instead. */ export function ProgressBar({ loading, total, current, inProgress = 0, reverseTheme = false, header, variation = "progress", size = "base", UNSAFE_style, }: ProgressBarProps) { const { t } = useAtlantisI18n(); const styles = useStyles(); const { tokens } = useAtlantisTheme(); return ( {header} {variation === "stepped" ? ( ) : ( {!loading && ( <> {inProgress && inProgress > 0 ? ( ) : ( <> )} )} )} ); function getA11yLabel(): string { const a11yLabelValues = { current: String(current), total: String(total), inProgress: String(inProgress), }; if (inProgress) { return t("ProgressBar.inProgress", a11yLabelValues); } return t("ProgressBar.complete", a11yLabelValues); } }