<script setup>
const props = defineProps({
  width: {
    type: String,
    default: "calc(100vw - 20px)",
  },
  rounded: {
    type: Number,
    default: 10,
  },
  onClick: {
    type: Function,
    default: () => {},
  },
  disabled: {
    type: Boolean,
    default: false,
  },
  backgroundColor: {
    type: String,
    default: "#fed847",
  },
  color: {
    type: String,
    default: "#000",
  },
});
</script>

<template>
  <button
    class="sbtn"
    hover-class="none"
    :style="{
      width: width,
      borderRadius: rounded + 'px',
      backgroundColor: disabled ? '#757575' : backgroundColor,
      color,
    }"
    open-type="getUserInfo"
    @click="
      () => {
        if (!disabled) onClick();
      }
    "
  >
    <slot />
  </button>
</template>

<style scoped>
.sbtn {
  margin: 0 auto;
  height: 44px;
  line-height: 44px;
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>
