PageHeaderCard.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <script setup>
  2. import BaseIcon from "./BaseIcon.vue";
  3. defineProps({
  4. icon: { type: [Object, Function], default: null },
  5. title: { type: String, required: true },
  6. description: { type: String, default: "" },
  7. iconClass: { type: String, default: "bg-primary/10 text-primary dark:bg-primary/20" },
  8. });
  9. </script>
  10. <template>
  11. <section class="rounded-2xl border border-gray-200 bg-gray-100/50 p-6 shadow-sm backdrop-blur-md dark:border-gray-700 dark:bg-secondary/50">
  12. <div class="flex flex-wrap items-center justify-between gap-4">
  13. <div class="flex items-center gap-4">
  14. <div
  15. v-if="icon"
  16. class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl"
  17. :class="iconClass"
  18. >
  19. <BaseIcon :icon="icon" class="h-5 w-5" />
  20. </div>
  21. <div class="min-w-0">
  22. <h2 class="text-base font-semibold text-foreground">{{ title }}</h2>
  23. <p v-if="description" class="mt-0.5 text-sm text-muted-foreground">{{ description }}</p>
  24. </div>
  25. </div>
  26. <slot name="actions" />
  27. </div>
  28. <slot />
  29. </section>
  30. </template>