mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-20 06:55:06 -04:00
18 lines
531 B
Vue
18 lines
531 B
Vue
<script setup lang="ts">
|
|
import { type Component, toRefs } from 'vue';
|
|
|
|
const props = defineProps<{ icon: Component; title: string; action: () => void; isActive?: () => boolean }>();
|
|
const { icon, title, action, isActive } = toRefs(props);
|
|
</script>
|
|
|
|
<template>
|
|
<n-tooltip trigger="hover">
|
|
<template #trigger>
|
|
<c-button circle variant="text" :type="isActive?.() ? 'primary' : 'default'" @click="action">
|
|
<n-icon :component="icon" />
|
|
</c-button>
|
|
</template>
|
|
|
|
{{ title }}
|
|
</n-tooltip>
|
|
</template>
|