<script setup>
import {NH1, NFlex, NSpace, NP} from 'naive-ui'
import {TbUsers} from "vue-icons-plus/tb";
import AppLayout from "../../Layouts/AppLayout.vue";
import {Link} from "@inertiajs/vue3";
import {computed} from "vue";
import {format} from "date-fns";
import {useNow} from "@vueuse/core";
import {ru} from "date-fns/locale";
import StartButton from "../../Components/StartButton.vue";

const currentDate = computed(() => {
    const formatted = format(useNow().value, 'PPPPpp', {
        locale: ru
    })

    return formatted.charAt(0).toUpperCase() + formatted.slice(1)
})
</script>

<template>
    <AppLayout>
        <div class="flex flex-col justify-start items-center mt-12">
            <NFlex vertical align="center" justify="center" class="max-w-xl w-full">
                <NSpace vertical align="center">
                    <NH1 class="mb-0!">
                        Панель администратора
                    </NH1>
                    <NP class="mb-4!">
                        {{ currentDate }}
                    </NP>
                </NSpace>

                <StartButton title="Учетные записи"
                             description="Создание и редактирование учетных записей"
                             href="/admin/users"
                             :tag="Link"
                             :icon="TbUsers"
                />
            </NFlex>
        </div>
    </AppLayout>
</template>

<style scoped>

</style>
