import React from 'react';
import type { ComponentProps } from 'react';
import StyledHeroIcon from './HeroIcon';
import SpinWrapper from './SpinWrapper';

type AnimatedIconProps = ComponentProps<typeof StyledHeroIcon>;

const AnimatedIcon = ({ style, ...otherProps }: AnimatedIconProps) => (
  <SpinWrapper style={style}>
    <StyledHeroIcon {...otherProps} />
  </SpinWrapper>
);

export default AnimatedIcon;
