Files
Caramel-CRM/resources/js/components/ui/social-icon/SocialIcon.vue
T

25 lines
871 B
Vue
Raw Normal View History

2025-11-04 17:45:48 +01:00
<script setup lang="ts">
import type { PrimitiveProps } from "reka-ui"
import { socialIconVariants, SocialIconVariant } from '.';
import { cn } from "@/lib/utils"
import type { HTMLAttributes } from "vue"
import { computed } from "vue"
const props = defineProps<PrimitiveProps & {
variant?: string,
class?: HTMLAttributes["class"]
}>();
const currentVariant = computed<SocialIconVariant>(() => {
const v = props.variant?.toLowerCase() as SocialIconVariant; // Konvertiere zu lowercase
return v && socialIconVariants[v] ? v : 'default';
});
</script>
<template>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" data-supported-dps="24x24" stroke="currentColor"
2026-02-17 10:35:03 +01:00
fill="transparent" :class="cn(props.class)" width="24" height="24" focusable="false">
2025-11-04 17:45:48 +01:00
<g v-html="socialIconVariants[currentVariant]"></g>
</svg>
</template>