forked from Stigmatoz/web-activity-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFavicon.vue
More file actions
35 lines (30 loc) · 669 Bytes
/
Favicon.vue
File metadata and controls
35 lines (30 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<template>
<img v-if="favIconValid" class="favicon no-favicon" height="22" :src="NO_FAVICON_URL" />
<img v-else class="favicon" height="30" :src="favicon" />
</template>
<script lang="ts">
export default {
name: 'Favicon',
};
</script>
<script lang="ts" setup>
import { computed } from 'vue';
import { NO_FAVICON_URL } from '../utils/consts';
const props = defineProps<{
favicon: string | undefined;
}>();
const favIconValid = computed(
() =>
props.favicon == undefined ||
props.favicon == '' ||
props.favicon.startsWith('chrome://favicon/'),
);
</script>
<style scoped>
.favicon {
padding: 5px;
}
.no-favicon {
margin: 0 5px;
}
</style>