aboutsummaryrefslogtreecommitdiff
path: root/src/components/ToolCard.vue
diff options
context:
space:
mode:
authorGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2022-12-17 01:30:02 +0100
committerGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2022-12-17 01:30:02 +0100
commit4cd809bd0c94836532f58a2ec6aa131694cce10d (patch)
tree7a2f5f61c3101a3c0761cc32b67a7f9ad67222e5 /src/components/ToolCard.vue
parent8d09086e78b6de1eb7108b8d3ba08fcca2c5d577 (diff)
downloadit-tools-4cd809bd0c94836532f58a2ec6aa131694cce10d.tar.gz
it-tools-4cd809bd0c94836532f58a2ec6aa131694cce10d.tar.zst
it-tools-4cd809bd0c94836532f58a2ec6aa131694cce10d.zip
feat(tools): added favorite tool handling
Diffstat (limited to 'src/components/ToolCard.vue')
-rw-r--r--src/components/ToolCard.vue31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/components/ToolCard.vue b/src/components/ToolCard.vue
index 926c5e9..79586f8 100644
--- a/src/components/ToolCard.vue
+++ b/src/components/ToolCard.vue
@@ -3,17 +3,21 @@
<n-card class="tool-card">
<n-space justify="space-between" align="center">
<n-icon class="icon" size="40" :component="tool.icon" />
- <n-tag
- v-if="tool.isNew"
- size="small"
- class="badge-new"
- round
- type="success"
- :bordered="false"
- :color="{ color: theme.primaryColor, textColor: theme.tagColor }"
- >
- New
- </n-tag>
+ <n-space align="center">
+ <n-tag
+ v-if="tool.isNew"
+ size="small"
+ class="badge-new"
+ round
+ type="success"
+ :bordered="false"
+ :color="{ color: theme.primaryColor, textColor: theme.tagColor }"
+ >
+ New
+ </n-tag>
+
+ <favorite-button :tool="tool" />
+ </n-space>
</n-space>
<n-h3 class="title">
<n-ellipsis>{{ tool.name }}</n-ellipsis>
@@ -29,11 +33,12 @@
</template>
<script setup lang="ts">
-import type { ITool } from '@/tools/tool';
+import type { Tool } from '@/tools/tools.types';
import { useThemeVars } from 'naive-ui';
import { toRefs } from 'vue';
+import FavoriteButton from './FavoriteButton.vue';
-const props = defineProps<{ tool: ITool & { category: string } }>();
+const props = defineProps<{ tool: Tool & { category: string } }>();
const { tool } = toRefs(props);
const theme = useThemeVars();
</script>