Open History to see the last commit
1import { RefreshCwIcon } from "lucide-react";
2
3import { cn } from "~/lib/utils";
4import { observeVisibleAnimation } from "~/lib/visibleAnimation";
5
6/** Keep the refresh glyph in place while its owning action is running. */
7export function RefreshIcon({
8 refreshing = false,
9 className,
10 ...props
11}: React.ComponentPropsWithoutRef<typeof RefreshCwIcon> & { refreshing?: boolean }) {
12 return (
13 <RefreshCwIcon
14 aria-hidden
15 ref={refreshing ? observeVisibleAnimation : undefined}
16 className={cn(refreshing && "motion-safe:visible-animate-spin", className)}
17 {...props}
18 />
19 );
20}