store/resources/js/components/ui/chart/ChartContainer.vue

20 lines
483 B
Vue

<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { provide, toRef } from 'vue'
import { cn } from '@/lib/utils'
import { ChartConfigSymbol, type ChartConfig } from '.'
const props = defineProps<{
config: ChartConfig
class?: HTMLAttributes['class']
}>()
provide(ChartConfigSymbol, toRef(props, 'config'))
</script>
<template>
<div :class="cn('flex aspect-video justify-center text-xs [&>div]:w-full', props.class)">
<slot />
</div>
</template>