aboutsummaryrefslogtreecommitdiff
path: root/src/components/ToolCard.vue
blob: bceaf1598e449a0b3266859e16ead7df5cc791e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<template>
    <router-link :to="tool.path">
        <n-card class="tool-card">
            <n-icon class="icon" size="35">
                <component :is="tool.icon" />
            </n-icon>
            <n-h3 class="title">{{ tool.name }}</n-h3>
            <div class="description">
                <n-ellipsis :line-clamp="2" :tooltip="false">{{ tool.description }}</n-ellipsis>
            </div>
        </n-card>
    </router-link>
</template>

<script setup lang="ts">
import type { ITool } from '@/tools/Tool';
import { toRefs, defineProps } from 'vue';

const props = defineProps<{ tool: ITool & { category: string } }>()
const { tool } = toRefs(props)

</script>

<style lang="less" scoped>
a {
    text-decoration: none;
}

.tool-card {
    &:hover {
        border-color: var(--n-color-target);
    }
    .icon {
        opacity: 0.7;
    }
    .title {
        margin: 5px 0;
    }
    .description {
        opacity: 0.7;
        margin: 5px 0;
    }
}
</style>