import type { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, } from 'react'; export function createSpinner({ Root, }: { Root: React.ComponentType; }) { Root.displayName = 'Spinner'; Root.defaultProps = { // @ts-ignore 'tabIndex': 0, 'aria-label': 'loading', }; return Root as ForwardRefExoticComponent< PropsWithoutRef & RefAttributes >; }