Sync live quote handling, SSE product images, store hours, file URL normalization, PWA icon cache, TV monitor, about software, SuperAdmin menu gates, price alerts, and related UX from modular while preserving boursecu branding and config constraints. Co-authored-by: Cursor <cursoragent@cursor.com>
71 lines
1.3 KiB
Vue
71 lines
1.3 KiB
Vue
<template>
|
|
<a
|
|
v-if="href && src"
|
|
referrerpolicy="origin"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
:href="href"
|
|
class="enamad-badge"
|
|
:class="`enamad-badge--${size}`"
|
|
>
|
|
<img
|
|
referrerpolicy="origin"
|
|
:src="src"
|
|
alt="enamad"
|
|
class="enamad-badge__img"
|
|
:code="code || undefined"
|
|
/>
|
|
</a>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { computed } from 'vue'
|
|
import { useSettingsStore } from '@/store/settingsStore'
|
|
|
|
withDefaults(
|
|
defineProps<{
|
|
size?: 'sm' | 'lg'
|
|
}>(),
|
|
{ size: 'sm' },
|
|
)
|
|
|
|
const settingsStore = useSettingsStore()
|
|
|
|
const href = computed(() =>
|
|
String(settingsStore.getSettingByKey('enamad_url') ?? '').trim(),
|
|
)
|
|
const src = computed(() =>
|
|
String(settingsStore.getSettingByKey('enamad_logo') ?? '').trim(),
|
|
)
|
|
const code = computed(() => {
|
|
try {
|
|
const u = new URL(href.value || src.value)
|
|
return u.searchParams.get('Code') || u.searchParams.get('code') || ''
|
|
} catch {
|
|
return ''
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.enamad-badge {
|
|
display: inline-flex;
|
|
line-height: 0;
|
|
}
|
|
|
|
.enamad-badge__img {
|
|
width: auto;
|
|
cursor: pointer;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.enamad-badge--sm .enamad-badge__img {
|
|
height: 40px;
|
|
}
|
|
|
|
.enamad-badge--lg .enamad-badge__img {
|
|
height: 120px;
|
|
max-width: 100%;
|
|
}
|
|
</style>
|