<script setup lang="ts">
import { useAuthorsStore } from '~/store/authors';

const props = defineProps(['user_id'])
const authorStore = useAuthorsStore()

const author = ref(authorStore.getItem(props.user_id))
const isOpen = ref(false)

watch(authorStore, () => {
    author.value = authorStore.getItem(props.user_id)
}, { deep: true })
</script>
<template>
    <template v-if="author.status == 'success'">
        {{ author.result }}
    </template>
    <template v-else>
        {{ props.user_id }}
    </template>
</template>