2023-05-28 23:13:24 +02:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { useThemeVars } from 'naive-ui';
|
|
|
|
import FavoriteButton from './FavoriteButton.vue';
|
|
|
|
import type { Tool } from '@/tools/tools.types';
|
|
|
|
|
|
|
|
const props = defineProps<{ tool: Tool & { category: string } }>();
|
|
|
|
const { tool } = toRefs(props);
|
|
|
|
const theme = useThemeVars();
|
|
|
|
</script>
|
|
|
|
|
2022-04-05 23:23:08 +02:00
|
|
|
<template>
|
2024-02-12 14:31:21 +01:00
|
|
|
<router-link :to="tool.path" class="decoration-none">
|
|
|
|
<c-card class="h-full transition transition-duration-0.5s !border-2px !hover:border-primary">
|
2023-05-27 17:36:15 +02:00
|
|
|
<div flex items-center justify-between>
|
2024-02-12 14:31:21 +01:00
|
|
|
<n-icon class="text-neutral-400 dark:text-neutral-600" size="40" :component="tool.icon" />
|
|
|
|
|
2023-05-27 17:36:15 +02:00
|
|
|
<div flex items-center gap-8px>
|
2024-02-12 14:31:21 +01:00
|
|
|
<div
|
2022-12-17 01:30:02 +01:00
|
|
|
v-if="tool.isNew"
|
2024-02-12 14:31:21 +01:00
|
|
|
class="rounded-full px-8px py-3px text-xs text-white dark:text-neutral-800"
|
|
|
|
:style="{
|
|
|
|
'background-color': theme.primaryColor,
|
|
|
|
}"
|
2022-12-17 01:30:02 +01:00
|
|
|
>
|
2023-10-22 16:21:10 +08:00
|
|
|
{{ $t('toolCard.new') }}
|
2024-02-12 14:31:21 +01:00
|
|
|
</div>
|
2022-12-17 01:30:02 +01:00
|
|
|
|
2023-05-28 23:13:24 +02:00
|
|
|
<FavoriteButton :tool="tool" />
|
2023-05-27 17:36:15 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-06-01 23:52:21 +02:00
|
|
|
|
2024-02-12 14:31:21 +01:00
|
|
|
<div class="truncat my-5px text-lg text-black dark:text-white">
|
|
|
|
{{ tool.name }}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="line-clamp-2 text-neutral-500 dark:text-neutral-400">
|
|
|
|
{{ tool.description }}
|
2022-04-15 23:10:47 +02:00
|
|
|
</div>
|
2023-04-20 20:49:28 +02:00
|
|
|
</c-card>
|
2022-04-15 23:10:47 +02:00
|
|
|
</router-link>
|
2022-04-05 23:23:08 +02:00
|
|
|
</template>
|