123456789101112131415161718192021222324252627282930313233343536
  1. <script setup>
  2. import { Link } from '@inertiajs/inertia-vue3'
  3. defineProps({
  4. links: Array,
  5. })
  6. </script>
  7. <template>
  8. <nav
  9. v-if="links.length > 3"
  10. class="p-paginator p-component flex justify-content-start"
  11. >
  12. <div class="p-paginator-pages">
  13. <template v-for="(link, key) in links">
  14. <div
  15. v-if="link.url === null"
  16. :key="`link-${key}`"
  17. class="p-paginator-page p-paginator-element p-link"
  18. :class="{ 'p-disabled': link }"
  19. v-html="link.label"
  20. />
  21. <Link
  22. v-if="link.url !== null"
  23. :key="`link-${key}`"
  24. :href="link.url"
  25. :class="{ 'p-highlight': link.active }"
  26. class="p-paginator-page p-paginator-element p-link"
  27. v-html="link.label"
  28. />
  29. </template>
  30. </div>
  31. </nav>
  32. </template>