{# API #}
{%- set props = props | default([]) -%}
{%- set _color = props.color | default(null) -%}

{# Class names #}
{%- set _rootClassName = _color ? _spiritClassPrefix ~ 'text-' ~ _color : '' -%}
{%- set _rootAnimationClassName = _spiritClassPrefix ~ 'animation-spin-clockwise' -%}

{# Miscellaneous #}
{%- set _styleProps = useStyleProps(props) -%}
{%- set _classNames = [ _rootClassName, _rootAnimationClassName, _styleProps.className ] -%}
{%- set _mainPropsWithoutColor = props | filter((value, prop) => prop is not same as('color')) -%}

{% embed "@spirit/icon.twig" with { props: _mainPropsWithoutColor | merge({
    name: 'spinner',
    UNSAFE_className: _classNames | join(' ') | trim,
    UNSAFE_style: _styleProps.style,
}) } %}{% endembed %}
