<template>
  <el-button type="primary" link :icon="Microphone" @click="handleTextToVoice">
    语音
  </el-button>
</template>

<script setup>
import { Microphone } from '@element-plus/icons-vue'
import { speakText } from '@/utils/speak'

const props = defineProps({
  text: {
    type: String,
    required: true
  }
})

function handleTextToVoice() {
  speakText(props.text)
}
</script> 