55 <div class =" first-block" >
66 <div class =" w-80" >
77 <p class =" url" @click =" openUrl(item.url)" >{{ url }}</p >
8- <div class = " d-inline-block " v-html = " getBadgeIcon() " ></ div >
8+ <BadgeIcons :url = " url " :type = " typeOfUrl " :listType = " listType " / >
99 </div >
1010 <p class =" text-right time" >{{ summaryTimeForTab }}</p >
1111 </div >
@@ -32,20 +32,18 @@ export default {
3232<script lang="ts" setup>
3333import { computed , ref } from ' vue' ;
3434import Favicon from ' ./Favicon.vue' ;
35+ import BadgeIcons from ' ./BadgeIcons.vue' ;
3536import { convertSummaryTimeToString } from ' ../utils/converter' ;
3637import { getPercentage } from ' ../utils/common' ;
3738import { CurrentTabItem } from ' ../dto/currentTabItem' ;
39+ import { TypeOfList , TypeOfUrl } from ' ../utils/enums' ;
3840
3941const props = defineProps <{
4042 item: CurrentTabItem ;
4143 summaryTimeForWholeDay: number ;
44+ listType: TypeOfList ;
4245}>();
4346
44- enum TypeOfUrl {
45- WebSite ,
46- Document ,
47- }
48-
4947const typeOfUrl = computed (() =>
5048 props .item .url .startsWith (' file:' ) ? TypeOfUrl .Document : TypeOfUrl .WebSite ,
5149);
@@ -75,10 +73,6 @@ function openUrl(url: string) {
7573}
7674
7775const showWarningMessage = ref <boolean >();
78-
79- function getBadgeIcon() {
80- if (typeOfUrl .value == TypeOfUrl .Document ) return ` <span class="badge-document">Document</span> ` ;
81- }
8276 </script >
8377
8478<style scoped>
@@ -141,14 +135,6 @@ function getBadgeIcon() {
141135.tab-item .sessions {
142136 margin : 0 0 0 5px ;
143137}
144- .tab-item ::v-deep span .badge-document {
145- border-radius : 6px ;
146- background-color : #0043ff9e ;
147- padding : 3px 7px ;
148- font-size : 11px ;
149- color : white ;
150- font-weight : 600 ;
151- }
152138.tab-item .warning-message {
153139 color : grey ;
154140}
0 commit comments