data-row.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div
  3. style="border-radius: 5px"
  4. :class="[
  5. 'flex text-[#00d9df] items-center justify-between border-b border-cyan-500/20 hover:bg-cyan-500/10 transition-colors px-2 -mx-2 rounded',
  6. compact ? 'py-1' : 'py-2'
  7. ]"
  8. >
  9. <span class="text-cyan-200">{{ label }}</span>
  10. <div class="flex items-center gap-2">
  11. <span class="font-mono text-white font-bold">{{ value }}</span>
  12. <button
  13. v-if="button"
  14. style="border-radius: 5px"
  15. :class="[
  16. 'px-3 py-1 rounded text-white text-sm transition-all',
  17. buttonColor === 'green'
  18. ? 'bg-green-600 hover:bg-green-500 shadow-[0_0_10px_rgba(22,163,74,0.5)]'
  19. : 'bg-red-600 hover:bg-red-500 shadow-[0_0_10px_rgba(220,38,38,0.5)]'
  20. ]"
  21. >
  22. {{ button }}
  23. </button>
  24. </div>
  25. </div>
  26. </template>
  27. <script setup lang="ts">
  28. interface Props {
  29. label: string
  30. value: string
  31. button?: string
  32. buttonColor?: 'green' | 'red'
  33. compact?: boolean
  34. }
  35. withDefaults(defineProps<Props>(), {
  36. compact: false
  37. })
  38. </script>