<script setup lang="ts">
import { Badge } from '~/components/pub/ui/badge'

const activeStatusCodes: Record<string, string> = {
  verified: 'Verifikasi',
  unverified: 'Belum Verifikasi',
}

const props = defineProps<{
  rec: any
  idx?: number
}>()

const statusText = computed(() => {
  const code: keyof typeof activeStatusCodes = props.rec.status_code === 1 ? `verified` : `unverified`
  return activeStatusCodes[code]
})

const badgeVariant = computed(() => {
  return props.rec.status_code === 1 ? 'default' : 'outline'
})
</script>

<template>
  <div class="flex justify-center">
    <Badge :variant="badgeVariant" class="rounded-2xl text-[0.6rem]" >
      {{ statusText }}
    </Badge>
  </div>
</template>