28 lines
453 B
Vue
28 lines
453 B
Vue
<script lang="ts" setup>
|
|
|
|
// import
|
|
|
|
import { usePersianTimeAgo } from "~/composables/global/usePersianTimeAgo";
|
|
|
|
// type
|
|
|
|
type Props = {
|
|
date: string
|
|
}
|
|
|
|
// props
|
|
|
|
const props = defineProps<Props>();
|
|
const { date } = toRefs(props);
|
|
|
|
// state
|
|
|
|
const timeAgo = usePersianTimeAgo(new Date(date.value));
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<div class="px-3 pb-1 pt-1.5 rounded-lg bg-neutral-600 text-white" dir="rtl">
|
|
{{ timeAgo }}
|
|
</div>
|
|
</template> |