import React from 'react'; import { LivenessClassNames } from '../types/classNames'; interface MatchIndicatorProps { percentage: number; initialPercentage?: number; testId?: string; } export const MatchIndicator: React.FC = ({ percentage, initialPercentage = 25, testId, }) => { const [matchPercentage, setMatchPercentage] = React.useState(initialPercentage); React.useEffect(() => { if (percentage < 0) { setMatchPercentage(0); } else if (percentage > 100) { setMatchPercentage(100); } else { setMatchPercentage(percentage); } }, [percentage]); const percentageStyles = { '--percentage': `${matchPercentage}%`, } as React.CSSProperties; return (
); };