chore: improve placeholder component styles (#3638)

Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
This commit is contained in:
Liyas Thomas
2023-12-12 15:02:42 +05:30
committed by GitHub
parent 4ac8a117ef
commit ebf90207e5
42 changed files with 479 additions and 413 deletions

View File

@@ -4,24 +4,29 @@
v-if="src"
:src="src"
loading="lazy"
class="inline-flex flex-col object-contain object-center mb-4"
class="inline-flex flex-col object-contain object-center"
:class="large ? 'w-32 h-32' : 'w-16 h-16'"
:alt="alt"
/>
<slot name="icon"></slot>
<span v-if="heading" class="mb-2 font-semibold text-center">
<span v-if="heading" class="font-semibold mt-2 text-center">
{{ heading }}
</span>
<span
class="max-w-sm mb-4 text-center whitespace-normal text-secondaryLight"
v-if="text"
class="max-w-sm mt-2 text-center whitespace-normal text-secondaryLight text-tiny"
>
{{ text }}
</span>
<slot></slot>
<div v-if="hasBody" class="mt-4">
<slot name="body"></slot>
</div>
</div>
</template>
<script setup lang="ts">
import { computed, useSlots } from "vue"
withDefaults(
defineProps<{
src?: string
@@ -35,4 +40,10 @@ withDefaults(
text: "",
}
)
const slots = useSlots()
const hasBody = computed(() => {
return !!slots.body
})
</script>