main
vue 48 lines 1023 Bytes
Raw
1 <template>
2 <div
3 class="question bg-secondary ring-primary/20 flex w-max max-w-80 shrink-0 cursor-pointer flex-col gap-3 rounded-lg p-2 text-xs transition-all hover:ring-1"
4 >
5 <div>{{ entity.question }}</div>
6 <div class="text-secondary description">
7 <div>
8 {{ entity.description }}
9 </div>
10 </div>
11 <div>
12 <n-tag size="small" class="text-[10px]! [&_.n-tag\_\_content]:p-0! [&_.n-tag\_\_content]:leading-0">
13 {{ entity.category }}
14 </n-tag>
15 </div>
16 </div>
17 </template>
18
19 <script setup lang="ts">
20 import type { ExampleQuestion } from "@/types/copilotMCP.d"
21 import { NTag } from "naive-ui"
22
23 const { entity } = defineProps<{ entity: ExampleQuestion }>()
24 </script>
25
26 <style lang="scss" scoped>
27 .question {
28 .description {
29 display: grid;
30 grid-template-rows: 0fr;
31 opacity: 0;
32
33 transition:
34 opacity 0.3s var(--bezier-ease),
35 grid-template-rows 0.3s var(--bezier-ease);
36
37 & > * {
38 overflow: hidden;
39 }
40 }
41 &:hover {
42 .description {
43 grid-template-rows: 1fr;
44 opacity: 1;
45 }
46 }
47 }
48 </style>