<script setup>
import { inject, computed } from 'vue'

const globalData = inject('globalData')

const generatedAt = computed(() => {
  if (!globalData.value?.GeneratedAt) return ''
  return new Date(globalData.value.GeneratedAt).toLocaleDateString('en-US', {
    year: 'numeric',
    month: 'short',
    day: 'numeric'
  })
})
</script>

<template>
  <footer class="py-8 px-4 mt-16 border-t border-gray-700">
    <div class="container mx-auto text-center">
      <p class="text-gray-400">
        Generated by
        <a
          href="https://github.com/lukaszraczylo/git-velocity"
          class="text-primary-400 hover:text-primary-300 font-medium"
          target="_blank"
          rel="noopener noreferrer"
        >
          Git Velocity
        </a>
      </p>
      <p v-if="generatedAt" class="text-sm text-gray-500 mt-2">
        {{ generatedAt }}
      </p>
    </div>
  </footer>
</template>
