index.vue 2.27 KB
<script lang="ts" setup>
const recentDevicesHeaders = [
  { title: 'BROWSER', key: 'browser' },
  { title: 'DEVICE', key: 'device' },
  { title: 'LOCATION', key: 'location' },
  { title: 'RECENT ACTIVITY', key: 'recentActivity' },
]

const recentDevices = [
  {
    browser: 'Chrome on Windows',
    device: 'HP Spectre 360',
    location: 'Mekah, UEA',
    recentActivity: '28 Apr 2022, 18:20',
    deviceIcon: { icon: 'ri-macbook-line', color: 'primary' },
  },
  {
    browser: 'Chrome on iPhone',
    device: 'iPhone 12x',
    location: 'Madinah, UEA',
    recentActivity: '20 Apr 2022, 10:20',
    deviceIcon: { icon: 'ri-android-line', color: 'error' },
  },
  {
    browser: 'Chrome on Android',
    device: 'Oneplus 9 Pro',
    location: 'Madinah, UEA',
    recentActivity: '16 Apr 2022, 04:20',
    deviceIcon: { icon: 'ri-smartphone-line', color: 'success' },
  },
  {
    browser: 'Chrome on macOS',
    device: 'Apple iMac',
    location: 'Mekah, UEA',
    recentActivity: '28 Apr 2022, 18:20',
    deviceIcon: { icon: 'ri-mac-line', color: 'secondary' },
  },
  {
    browser: 'Chrome on Windows',
    device: 'HP Spectre 360',
    location: 'Madinah, UEA',
    recentActivity: '20 Apr 2022, 10:20',
    deviceIcon: { icon: 'ri-macbook-line', color: 'primary' },
  },
  {
    browser: 'Chrome on Android',
    device: 'Oneplus 9 Pro',
    location: 'Madinah, UEA',
    recentActivity: '16 Apr 2022, 04:20',
    deviceIcon: { icon: 'ri-android-line', color: 'success' },
  },
]

</script>

<template>
  <VRow>
    <!-- SECTION Recent Devices -->
    <VCol cols="12">
      <!-- 👉 Table -->
      <VCard title="Recent Devices" class="recentDeviceCard">
        <VDataTable :headers="recentDevicesHeaders" :items="recentDevices" hide-default-footer class="text-no-wrap">
          <template #item.browser="{ item }">
            <div class="d-flex gap-x-3">
              <VIcon size="20" :icon="item.deviceIcon.icon" :color="item.deviceIcon.color" />
              <h6 class="text-h6">
                {{ item.browser }}
              </h6>
            </div>
          </template>
          <!-- TODO Refactor this after vuetify provides proper solution for removing default footer -->
          <template #bottom />
        </VDataTable>
      </VCard>
    </VCol>
    <!-- !SECTION -->
  </VRow>
</template>