<template>
  <div
    :style="style"
    class="mm-loading">
    <svg
      class="circular"
      viewBox="25 25 50 50">
      <circle
        :stroke-width="strokeWidth"
        class="path"
        cx="50"
        cy="50"
        r="20"
        fill="none"
        stroke-miterlimit="10" />
    </svg>
  </div>
</template>

<script>
import config from "../../managers/config"

config.defaults({
  "Loading.size": "16px",
  "Loading.strokeWidth": 2,
  "Loading.color": "currentColor",
})

export default {
  name: "mm-loading",
  props: {
    size: {
      type: String,
      default: () => config.get("Loading.size"),
    },
    strokeWidth: {
      type: Number,
      default: () => config.get("Loading.strokeWidth"),
    },
    color: {
      type: String,
      default: () => config.get("Loading.color"),
    },
  },
  computed: {
    style() {
      return {
        height: this.size,
        width: this.size,
        color: this.color,
      }
    },
  },
}
</script>
