aboutsummaryrefslogtreecommitdiff
path: root/src/tools/html-wysiwyg-editor/editor/menu-bar-item.vue
blob: 5be2329226d01e477ae6a8daa978ce9f438f08b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script setup lang="ts">
import type { Component } from 'vue';

const props = defineProps<{ icon: Component; title: string; action: () => void; isActive?: () => boolean }>();
const { icon, title, action, isActive } = toRefs(props);
</script>

<template>
  <c-tooltip :tooltip="title">
    <c-button circle variant="text" :type="isActive?.() ? 'primary' : 'default'" @click="action">
      <n-icon :component="icon" />
    </c-button>
  </c-tooltip>
</template>