Files
archie/ui/src/chat/ChatEmptyState.vue
T

38 lines
1.5 KiB
Vue

<script setup lang="ts">
import { computed } from "vue";
import { useAccountsStore } from "@/accounts/accounts";
import Logo from "@/components/topbar/Logo.vue";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import ChatSuggestions from "./ChatSuggestions.vue";
import { chatModelReady } from "./state";
/**
* What the panel opens on before there is a conversation: the mark, a greeting
* and the prompts for this page. Once the conversation has messages the
* prompts move beside the composer.
*/
const accounts = useAccountsStore();
const greeting = computed(() => {
const first = accounts.status?.user?.display_name.trim().split(/\s+/)[0];
return first ? `How can I help, ${first}?` : "How can I help?";
});
</script>
<template>
<div class="w-full self-center justify-self-center px-1 py-6">
<div aria-hidden="true" class="mb-4 flex justify-center">
<Logo :open="false" class="text-[4rem]!" />
</div>
<h2 class="mb-5 text-center text-xl font-semibold tracking-tight">{{ greeting }}</h2>
<ChatSuggestions v-if="chatModelReady" list />
<Alert v-else class="text-label">
<AlertDescription class="flex flex-wrap items-center justify-between gap-2">
No chat model connected.
<Button as-child variant="outline" size="sm"><RouterLink to="/settings/models" class="no-underline">Choose a model</RouterLink></Button>
</AlertDescription>
</Alert>
</div>
</template>