workbench-trends.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <script setup lang="ts">
  2. import type { WorkbenchTrendItem } from '../typing';
  3. import {
  4. Card,
  5. CardContent,
  6. CardHeader,
  7. CardTitle,
  8. VbenIcon,
  9. } from '@vben-core/shadcn-ui';
  10. interface Props {
  11. items?: WorkbenchTrendItem[];
  12. title: string;
  13. }
  14. defineOptions({
  15. name: 'WorkbenchTrends',
  16. });
  17. withDefaults(defineProps<Props>(), {
  18. items: () => [],
  19. });
  20. </script>
  21. <template>
  22. <Card>
  23. <CardHeader class="py-4">
  24. <CardTitle class="text-lg">{{ title }}</CardTitle>
  25. </CardHeader>
  26. <CardContent class="flex flex-wrap p-5 pt-0">
  27. <ul class="divide-border w-full divide-y" role="list">
  28. <li
  29. v-for="item in items"
  30. :key="item.title"
  31. class="flex justify-between gap-x-6 py-5"
  32. >
  33. <div class="flex min-w-0 items-center gap-x-4">
  34. <VbenIcon
  35. :icon="item.avatar"
  36. alt=""
  37. class="size-10 flex-none rounded-full"
  38. />
  39. <div class="min-w-0 flex-auto">
  40. <p class="text-foreground text-sm font-semibold leading-6">
  41. {{ item.title }}
  42. </p>
  43. <!-- eslint-disable vue/no-v-html -->
  44. <p
  45. class="text-foreground/80 *:text-primary mt-1 truncate text-xs leading-5"
  46. v-html="item.content"
  47. ></p>
  48. </div>
  49. </div>
  50. <div class="hidden h-full shrink-0 sm:flex sm:flex-col sm:items-end">
  51. <span class="text-foreground/80 mt-6 text-xs leading-6">
  52. {{ item.date }}
  53. </span>
  54. </div>
  55. </li>
  56. </ul>
  57. </CardContent>
  58. </Card>
  59. </template>