This repository has been archived on 2025-12-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Caramel-CRM-Backup/resources/js/components/ui/social-icon/SocialIcon.vue
T

25 lines
889 B
Vue

<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"
fill="transparent" stroke-width="1.5" :class="cn(props.class)" width="24" height="24" focusable="false">
<g v-html="socialIconVariants[currentVariant]"></g>
</svg>
</template>