'use client'; import { ActionIcon, Tooltip } from '@mantine/core'; import { useState } from 'react'; import { BiRefresh } from 'react-icons/bi'; import styles from './RefreshButton.module.css'; interface Props { onRefresh: () => void; isRefreshing?: boolean; /** Tooltip and accessible name. */ label: string; color?: string; size?: number | string; } export default function RefreshButton(props: Props) { const [spins, setSpins] = useState(0); return ( { setSpins((count) => count + 1); props.onRefresh(); }} aria-label={props.label} data-analytics-action="refresh" > 0 ? styles.spinning : undefined } /> ); }