defmodule AshHqWeb.Pages.Ashley do @moduledoc "Ashley page" use Surface.LiveComponent import AshHqWeb.Tails alias Phoenix.LiveView.JS alias Surface.Components.Form alias Surface.Components.Form.{ Field, TextArea, TextInput } prop(current_user, :any) prop(params, :map) data(messages, :list) data(message_form, :any) data(new_message_form, :any) data(conversation, :any) data(conversations, :list) data(editing_conversation, :boolean) data(conversation_form, :any) def render(assigns) do ~F"""
{#if is_nil(@current_user) || !@current_user.ashley_access} You do not have access to this page. {#else}
{#if @conversation} {#if @editing_conversation}
{#else}
{@conversation.name}
{/if}
Hello! My name is Ashley. I've been instructed to answer your questions as factually as possible, but I am *far* from perfect. My code snippets especially are not likely to be accurate. However, I cite my sources below each answer to show you what content I thought was relevant, so please use that for official clarification.

{#for question <- @conversation.questions}
{question.question}

{raw(question.answer_html)}
{#if question.sources != []}

Sources

{/if}
{/for}
{@conversation.question_count} of {AshHq.Ashley.Conversation.conversation_limit()} used