import React, { useMemo } from 'react'; import './PullToRefreshIndicator.css'; interface Props { pullDistance: number; threshold: number; refreshing: boolean; } export const PullToRefreshIndicator: React.FC = ({ pullDistance, threshold, refreshing }) => { const progress = Math.min(1, pullDistance / threshold); const size = 24; const stroke = 3; const radius = (size - stroke) / 2; const circumference = 2 * Math.PI * radius; const dash = useMemo(() => circumference * progress * 0.85, [circumference, progress]); return (
{!refreshing && ( )}
); };