Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vswamidass-sfdc committed Oct 18, 2024
1 parent fb7f640 commit 1e19017
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions app/views/chats/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,24 @@
</div>
<div id="chats" class="min-w-full mt-5 space-y-4">
<% @chats.order(created_at: :desc).each do |chat| %>
<% @chats.order(created_at: :desc).each do |chat| %>
<% cache(chat) do %> <!-- Cache each chat entry -->
<%= link_to chat_path(chat), class: "block bg-white rounded-lg shadow-lg p-4 hover:bg-gray-100" do %>
<div class="flex justify-between items-center">
<div class="w-5/6">
<div class="flex items-center text-stone-600 mb-1">
<!-- Icon here -->
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 mr-1">
<path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" />
</svg>
<h2 class="font-bold text-xl "><%= chat.assistant.name %></h2>
</div>
<p class="text-gray-700 font-mono"><%= truncate(chat.first_message, length: 100) %></p>
</div>
<div class="text-gray-500 text-sm">
<%= chat.created_at.strftime("%B %d, %Y %I:%M %p") %>
<p class="text-gray-400 text-xs">By: <%= chat.user.email %></p>
<% cache(chat) do %> <!-- Cache each chat entry -->
<%= link_to chat_path(chat), class: "block bg-white rounded-lg shadow-lg p-4 hover:bg-gray-100" do %>
<div class="flex justify-between items-center">
<div class="w-5/6">
<div class="flex items-center text-stone-600 mb-1">
<!-- Icon here -->
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 mr-1">
<path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" />
</svg>
<h2 class="font-bold text-xl "><%= chat.assistant.name %></h2>
</div>
<p class="text-gray-700 font-mono"><%= truncate(chat.first_message, length: 100) %></p>
</div>
<div class="text-gray-500 text-sm">
<%= chat.created_at.strftime("%B %d, %Y %I:%M %p") %>
<p class="text-gray-400 text-xs">By: <%= chat.user.email %></p>
</div>
<% end %>
</div>
<% end %>
<% end %>
<% end %>
Expand Down

0 comments on commit 1e19017

Please sign in to comment.