<script setup>
import { NTooltip } from 'naive-ui'
import {TbClick} from 'vue-icons-plus/tb'
const props = defineProps({
    isTotalRow: Boolean,
    value: Number
})
const emits = defineEmits(['openModal'])

const handleClick = () => {
    if (props.isTotalRow) {
        emits('openModal')
    }
}
</script>

<template>
    <NTooltip v-if="isTotalRow" placement="top" :arrow="false">
        <template #trigger>
            <div class="relative inset-0 flex items-center justify-center cursor-pointer" @click="handleClick">
                {{ value }}
                <NIcon class="absolute -right-1 -top-1">
                    <TbClick size="14" />
                </NIcon>
            </div>
        </template>
        Кликните на ячейку для просмотра
    </NTooltip>
    <span v-else>{{ value }}</span>
</template>

<style scoped>

</style>
