<!--
 * @Author: chris
 * @Date: 2026-01-20 14:57:48
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2026-03-18 15:09:11
-->
<script setup>
import CommonActionToolbar from '@/components/CommonActionToolbar/index.vue'

const props = defineProps({
  selectedRows: { type: Array, required: true },
  columns: { type: Array, required: true },
})

const emits = defineEmits(['delete'])

// 按钮配置
const buttons = reactive([
  {
    key: 'delete',
    text: '删除',
    type: 'danger',
    plain: true,
    icon: 'Delete',
    action: 'delete',
    disabled: computed(() => props.selectedRows.length === 0)
  },
])

function handleButtonClick(action) {
  emits(action, props.selectedRows)
}
</script>

<template>
  <common-action-toolbar
    :buttons="buttons"
    :selectedRows="props.selectedRows"
    :columns="props.columns"
    @buttonClick="handleButtonClick"
  ></common-action-toolbar>
</template>
