Added social icon component. Fixes #3

This commit is contained in:
2025-11-04 17:45:48 +01:00
parent 15b49f4d23
commit d531c0a935
3 changed files with 102 additions and 1 deletions
@@ -0,0 +1,25 @@
<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>