HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/node_modules/flowbite-vue/src/components/FwbCard/FwbCard.vue
<template>
  <component
    :is="wrapperType"
    :class="cardClasses"
    :href="href"
  >
    <img
      v-if="imgSrc"
      :alt="imgAlt"
      :class="horizontalImageClasses"
      :src="imgSrc"
      class="rounded-t-lg"
    >
    <div>
      <slot />
    </div>
  </component>
</template>

<script lang="ts" setup>
import { computed, type PropType, toRefs } from 'vue'
import { useCardsClasses } from './composables/useCardClasses'
import type { CardsVariant } from './types'

const props = defineProps({
  href: {
    type: String,
    default: '',
  },
  imgAlt: {
    type: String,
    default: '',
  },
  imgSrc: {
    type: String,
    default: '',
  },
  variant: {
    type: String as PropType<CardsVariant>,
    default: 'default',
  },
})

const { cardClasses, horizontalImageClasses } = useCardsClasses(toRefs(props))
const wrapperType = computed(() => props.href ? 'a' : 'div')
</script>