<script lang="ts">
  let { size = 32 }: { size?: number } = $props();
</script>

<div class="loading-indicator">
  <div class="loading-indicator-inner" style:--size={size}></div>
</div>

<style>
  .loading-indicator {
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }

  .loading-indicator-inner {
    border: 8px solid var(--primary-color);
    border-top: 8px solid var(--accent-color);
    border-radius: 50%;
    width: var(--size);
    height: var(--size);
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
</style>
