mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-24 02:02:35 -04:00
15 lines
461 B
Vue
15 lines
461 B
Vue
<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>
|