<template>
<v-tooltip :text="tooltip" location="top">
  <template v-slot:activator="{ props }">
    <v-btn v-bind="props" :color="isCurrent?'primary':undefined" variant="text"
           :icon="icon" @click="$router.push(path)"/>
  </template>
</v-tooltip>
</template>

<script setup>
import {computed} from "vue";
import {useRoute} from "vue-router";

const props = defineProps(['icon', 'path', 'tooltip'])
const route = useRoute();
const isCurrent = computed(() => route.path === props.path)
</script>

<style scoped lang="scss">

</style>