From 11720e6cdefc1da4bdd638415813b609840f8462 Mon Sep 17 00:00:00 2001
From: Corentin Thomasset <corentin.thomasset74@gmail.com>
Date: Wed, 1 Jun 2022 23:52:21 +0200
Subject: feat(tools): new badge for recently created tools

---
 src/components/MenuIconItem.vue | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/components/MenuIconItem.vue

(limited to 'src/components/MenuIconItem.vue')

diff --git a/src/components/MenuIconItem.vue b/src/components/MenuIconItem.vue
new file mode 100644
index 0000000..0909e56
--- /dev/null
+++ b/src/components/MenuIconItem.vue
@@ -0,0 +1,36 @@
+<template>
+  <div class="menu-icon-item">
+    <n-icon :component="tool.icon" />
+    <div v-if="tool.isNew" class="badge"></div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import type { ITool } from '@/tools/tool';
+import { useThemeVars } from 'naive-ui';
+import { toRefs } from 'vue';
+
+const props = defineProps<{ tool: ITool }>();
+const { tool } = toRefs(props);
+
+const theme = useThemeVars();
+</script>
+
+<style lang="less" scoped>
+.menu-icon-item {
+  position: relative;
+
+  .badge {
+    position: absolute;
+    background-color: v-bind('theme.primaryColor');
+    border-radius: 10px;
+    line-height: 1;
+    top: 3px;
+    left: -6px;
+    font-size: 10px;
+
+    height: 6px;
+    width: 6px;
+  }
+}
+</style>
-- 
cgit v1.2.3

