1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <script setup>
  2. import { ref } from 'vue'
  3. import { Head } from '@inertiajs/inertia-vue3'
  4. import AppLayout from '@/layouts/AppLayout.vue'
  5. defineProps({
  6. cardStatistics: Object,
  7. chartStatistics: Object,
  8. })
  9. const basicData = ref({
  10. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  11. datasets: [
  12. {
  13. label: 'My First dataset',
  14. backgroundColor: '#42A5F5',
  15. data: [65, 59, 80, 81, 56, 55, 40],
  16. },
  17. {
  18. label: 'My Second dataset',
  19. backgroundColor: '#FFA726',
  20. data: [28, 48, 40, 19, 86, 27, 90],
  21. },
  22. ],
  23. })
  24. </script>
  25. <template>
  26. <AppLayout>
  27. <Head title="Dashboard" />
  28. <div class="grid">
  29. <div v-for="cardStatistic in cardStatistics" class="col-12 md:col-3">
  30. <Card class="h-full">
  31. <template #content>
  32. <div class="flex justify-content-between mb-3">
  33. <div>
  34. <span class="block text-500 font-medium mb-3">{{ cardStatistic.label }}</span>
  35. <div v-if="cardStatistic.value" class="text-900 font-medium text-xl">{{ cardStatistic.value }}</div>
  36. </div>
  37. <div
  38. class="flex align-items-center justify-content-center bg-orange-100 border-round"
  39. style="width: 2.5rem; height: 2.5rem"
  40. >
  41. <i class="text-orange-500 text-xl" :class="cardStatistic.icon"></i>
  42. </div>
  43. </div>
  44. <span class="text-green-500 font-medium">{{ cardStatistic.amount }} </span>
  45. <span class="text-500"> {{ ' ' + cardStatistic.amountLabel }}</span>
  46. </template>
  47. </Card>
  48. </div>
  49. <div class="col-12 md:col-6">
  50. <Card>
  51. <template #title>Statistik Transaksi</template>
  52. <template #content>
  53. <Chart type="bar" :data="basicData" />
  54. </template>
  55. </Card>
  56. </div>
  57. </div>
  58. </AppLayout>
  59. </template>