28 lines
688 B
Vue
28 lines
688 B
Vue
<script lang='ts' setup>
|
|
import type { PrimitiveProps } from 'reka-ui'
|
|
import type { HTMLAttributes } from 'vue'
|
|
import { cn } from '@/lib/utils'
|
|
import { Primitive } from 'reka-ui'
|
|
|
|
interface Props extends PrimitiveProps {
|
|
class?: HTMLAttributes['class']
|
|
}
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
as: 'div',
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<Primitive
|
|
data-slot="message-avatar"
|
|
:as="as"
|
|
:as-child="asChild"
|
|
:class="cn(
|
|
'min-w-8 group-has-data-[slot=message-footer]/message:-translate-y-8 flex w-fit shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted',
|
|
props.class,
|
|
)"
|
|
>
|
|
<slot />
|
|
</Primitive>
|
|
</template>
|