<template>
    <div class="mb-2 ms-4 p-2">
        <span
            class="absolute -mt-1 flex items-center justify-center w-6 h-6 bg-blue-100 rounded-full -start-3 ring-4 ring-white dark:ring-zinc-900 dark:bg-blue-900">
            <IconKeyword class="size-5 text-zinc-100" />
        </span>
        <div class="shadow-2xl rounded-lg p-2">
        <!-- activity info -->
        <div class="flex items-center text-sm font-bold tracking-tight text-zinc-950 dark:text-white">
            <h5 class="">
                {{ instance.title }}
            </h5>
            <NuxtLink :to="useRuntimeConfig().public.router.Keyword + instance.content">
                <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
                    stroke="currentColor" class="size-5 mr-2 ">
                    <path stroke-linecap="round" stroke-linejoin="round"
                        d="M21 16.811c0 .864-.933 1.406-1.683.977l-7.108-4.061a1.125 1.125 0 0 1 0-1.954l7.108-4.061A1.125 1.125 0 0 1 21 8.689v8.122ZM11.25 16.811c0 .864-.933 1.406-1.683.977l-7.108-4.061a1.125 1.125 0 0 1 0-1.954l7.108-4.061a1.125 1.125 0 0 1 1.683.977v8.122Z" />
                </svg>
            </NuxtLink>
        </div>
        <p class="mb-1 font-normal text-zinc-700 dark:text-zinc-400">
            {{ instance.abstract }}
        </p>
        <!-- user profile -->
        <UserProfile :user="instance.user"/>
        <div class="flex justify-end items-end mt-1">
            <div class="flex flex-col items-end">
                <p class="mt-1 text-xs text-left font-normal text-zinc-500 dark:text-zinc-400">
                    {{ toPersianNumbers(instance.persian_date) }}
                </p>
                <ActivityStatistics :instance="instance" />
            </div>
        </div>
    </div>
    </div>
</template>

<script setup>
const props = defineProps(['instance'])
const instance = props.instance
const { $toPersianNumbers } = useNuxtApp();
const toPersianNumbers = $toPersianNumbers;
</script>