mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-24 02:02:35 -04:00
23 lines
598 B
Vue
23 lines
598 B
Vue
<template>
|
|
<n-tooltip trigger="hover">
|
|
<template #trigger>
|
|
<n-button circle quaternary :type="isActive?.() ? 'primary' : 'default'" @click="action">
|
|
<template #icon>
|
|
<n-icon :component="icon" />
|
|
</template>
|
|
</n-button>
|
|
</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>
|