<template>
  <view class="result-actions">
    <view :class="['result-action', 'is-primary', { 'is-disabled': saving }]" @tap="handleSave">
      {{ saving ? "保存中..." : "保存图片" }}
    </view>

    <button class="result-action is-secondary" open-type="share" hover-class="none">分享好友</button>
  </view>
</template>

<script setup>
const props = defineProps({
  saving: {
    type: Boolean,
    default: false,
  },
});

const emit = defineEmits(["save"]);

const handleSave = () => {
  if (!props.saving) {
    emit("save");
  }
};
</script>

<style scoped lang="scss">
@import "./styles/index.scss";
</style>
