All files / apps/huella-legal/layers/articles/app/components/article MediaFallback.vue

100% Statements 5/5
100% Branches 3/3
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 37 38 39 40 41  32x                                                       32x       32x         32x    
<template>
    <div
        class="relative flex size-full items-center justify-center overflow-hidden"
        :class="ui.root"
        aria-hidden="true"
    >
        <span class="font-serif text-glyph leading-none select-none">ยง</span>
        <span
            v-if="label"
            class="absolute bottom-3 left-4 font-sans text-label font-semibold tracking-label uppercase"
            :class="ui.label"
            >{{ label }}</span
        >
    </div>
</template>
 
<script setup lang="ts">
import type { Tone } from "~/types/Tone";
 
interface Recipe {
    root: string;
    label: string;
}
 
interface Props {
    label?: string;
    tone?: Tone;
}
 
const props = withDefaults(defineProps<Props>(), {
    tone: "paper",
});
 
const TONES = {
    paper: { root: "bg-accented text-ivory-400", label: "text-ivory-700" },
    slate: { root: "bg-huella-slate-800 text-huella-slate-600", label: "text-huella-slate-300" },
} as const satisfies Record<Tone, Recipe>;
 
const ui = computed<Recipe>(() => TONES[props.tone]);
</script>