<script setup lang="ts">
import type { AvatarFallbackProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { AvatarFallback } from "reka-ui"
import { cn } from "@/lib/utils"

export interface AvatarFallbackWrapperProps extends AvatarFallbackProps {
  class?: HTMLAttributes["class"]
}

const props = defineProps<AvatarFallbackWrapperProps>()
const delegatedProps = reactiveOmit(props, "class")
</script>

<template>
  <AvatarFallback
    v-bind="delegatedProps"
    :class="cn('flex h-full w-full items-center justify-center bg-secondary text-secondary-foreground', props.class)"
  >
    <slot />
  </AvatarFallback>
</template>
