Skip to content

Commit

Permalink
refactor ToolPanelLabel to typescript & composition
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Apr 27, 2024
1 parent 73bb46c commit 4de84c8
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions client/src/components/Panels/Common/ToolPanelLabel.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
<script setup lang="ts">
import { computed } from "vue";
import type { ToolSectionLabel } from "@/stores/toolStore";
import ToolPanelLinks from "./ToolPanelLinks.vue";
const props = defineProps<{
definition: ToolSectionLabel;
}>();
const description = computed(() => props.definition.description || undefined);
</script>

<template>
<div v-b-tooltip.topright.hover.noninteractive class="tool-panel-label" tabindex="0" :title="description">
{{ definition.text }}
<ToolPanelLinks :links="definition.links" />
<ToolPanelLinks :links="definition.links || undefined" />
</div>
</template>

<script>
import ToolPanelLinks from "./ToolPanelLinks";
export default {
components: { ToolPanelLinks },
props: {
definition: {
type: Object,
required: true,
},
},
computed: {
description() {
return this.definition.description;
},
},
};
</script>

<style scoped lang="scss">
.tool-panel-label {
&:deep(.tool-panel-links) {
Expand Down

0 comments on commit 4de84c8

Please sign in to comment.