-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAppBrowserIcon.vue
More file actions
36 lines (29 loc) · 968 Bytes
/
AppBrowserIcon.vue
File metadata and controls
36 lines (29 loc) · 968 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
36
<script setup lang="ts">
// Components
import AppIcon from '@/components/app/AppIcon.vue'
// Utilities
import { computed } from 'vue'
const browsers = {
chrome: { icon: 'chrome', color: 'text-[#34A853]', title: 'Chrome' },
firefox: { icon: 'firefox', color: 'text-[#FF7139]', title: 'Firefox' },
safari: { icon: 'safari', color: 'text-[#006CFF]', title: 'Safari' },
edge: { icon: 'edge', color: 'text-[#0078D4]', title: 'Edge' },
opera: { icon: 'opera', color: 'text-[#FF1B2D]', title: 'Opera' },
} as const
export type BrowserName = keyof typeof browsers
export interface AppBrowserIconProps {
browser: BrowserName
size?: number
}
const { browser, size = 18 } = defineProps<AppBrowserIconProps>()
const config = computed(() => browsers[browser])
</script>
<template>
<AppIcon
class="align-sub"
:class="config.color"
:icon="config.icon"
:size="size"
:title="config.title"
/>
</template>