feat(AvatarGroup): new component (#71)

Co-authored-by: Romain Hamel <romain@boilr.io>
This commit is contained in:
Benjamin Canac
2024-04-26 17:04:49 +02:00
committed by GitHub
parent 26bfdfc54d
commit def5f7c10b
14 changed files with 280 additions and 10 deletions

View File

@@ -0,0 +1,12 @@
import { inject, provide, computed, type ComputedRef } from 'vue'
import type { AvatarGroupProps } from '#ui/types'
export function useAvatarGroup(props: { size: AvatarGroupProps['size'] }) {
const injectedSize = inject<ComputedRef<AvatarGroupProps['size']> | undefined>('avatar-size', undefined)
const size = computed(() => props.size ?? injectedSize?.value)
provide('avatar-size', size)
return {
size
}
}