2023-03-26 19:04:42 +02:00
|
|
|
<template>
|
|
|
|
<n-tooltip trigger="hover">
|
|
|
|
<template #trigger>
|
2023-04-19 21:38:59 +02:00
|
|
|
<c-button circle variant="text" :type="isActive?.() ? 'primary' : 'default'" @click="action">
|
|
|
|
<n-icon :component="icon" />
|
|
|
|
</c-button>
|
2023-03-26 19:04:42 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
{{ title }}
|
|
|
|
</n-tooltip>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { toRefs, type Component } from 'vue';
|
|
|
|
|
|
|
|
const props = defineProps<{ icon: Component; title: string; action: () => void; isActive?: () => boolean }>();
|
|
|
|
const { icon, title, action, isActive } = toRefs(props);
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped></style>
|