|
11 | 11 | <h1 class="text-2xl font-bold text-gray-800 mb-6 flex items-center"> |
12 | 12 | My Activity |
13 | 13 | </h1> |
14 | | - <div class="grid grid-cols-1 md:grid-cols-3 gap-6"> |
| 14 | + <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6"> |
15 | 15 | <!-- Questions --> |
16 | 16 | <div class="bg-white rounded-lg p-6 border border-gray-300"> |
17 | 17 | <div class="flex justify-between items-center mb-4"> |
18 | | - <h2 class="text-lg font-semibold text-gray-700 flex items-center"> |
| 18 | + <h2 class="text-lg font-semibold text-gray-500 flex items-center"> |
19 | 19 | <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
20 | 20 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z" /> |
21 | 21 | </svg> |
|
44 | 44 | <!-- Chats --> |
45 | 45 | <div class="bg-white rounded-lg p-6 border border-gray-300"> |
46 | 46 | <div class="flex justify-between items-center mb-4"> |
47 | | - <h2 class="text-lg font-semibold text-gray-700 flex items-center"> |
| 47 | + <h2 class="text-lg font-semibold text-gray-500 flex items-center"> |
48 | 48 | <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
49 | 49 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155" /> |
50 | 50 | </svg> |
|
70 | 70 | <% end %> |
71 | 71 | </div> |
72 | 72 | </div> |
73 | | - <!-- Assistants --> |
| 73 | + |
| 74 | + <!-- Recently Viewed Documents --> |
74 | 75 | <div class="bg-white rounded-lg p-6 border border-gray-300"> |
75 | 76 | <div class="flex justify-between items-center mb-4"> |
76 | | - <h2 class="text-lg font-semibold text-gray-700 flex items-center"> |
| 77 | + <h2 class="text-lg font-semibold text-gray-500 flex items-center"> |
77 | 78 | <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
78 | | - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" 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" /> |
| 79 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" /> |
| 80 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /> |
79 | 81 | </svg> |
80 | | - Assistants |
| 82 | + Documents |
81 | 83 | </h2> |
82 | | - <%= link_to assistants_path, class: "inline-flex items-center px-3 py-1 border border-sky-500 text-sky-500 text-sm font-medium rounded-md hover:bg-sky-500 hover:text-white transition-colors duration-200" do %> |
| 84 | + <%= link_to documents_path, class: "inline-flex items-center px-3 py-1 border border-sky-500 text-sky-500 text-sm font-medium rounded-md hover:bg-sky-500 hover:text-white transition-colors duration-200" do %> |
83 | 85 | More |
84 | 86 | <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
85 | 87 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /> |
86 | 88 | </svg> |
87 | 89 | <% end %> |
88 | 90 | </div> |
89 | 91 | <div class=""> |
90 | | - <% if @recent_assistants.any? %> |
91 | | - <% @recent_assistants.each do |assistant| %> |
| 92 | + <% if @recently_viewed_documents.any? %> |
| 93 | + <% @recently_viewed_documents.each do |document| %> |
| 94 | + <% viewed_item = document.viewed_items.find_by(user: current_user) %> |
92 | 95 | <%= render "dashboard/list_item", |
93 | | - path: assistant_path(assistant), |
94 | | - title: assistant.name, |
95 | | - subtitle: "Last active #{time_ago_in_words(assistant.last_chat_time)} ago" %> |
| 96 | + path: document_path(document), |
| 97 | + title: document.title.truncate(50), |
| 98 | + subtitle: "Viewed #{time_ago_in_words(viewed_item.viewed_at)} ago" %> |
96 | 99 | <% end %> |
97 | 100 | <% else %> |
98 | | - <p class="text-gray-400 italic">No recent assistants</p> |
| 101 | + <p class="text-gray-400 italic">No recently viewed documents</p> |
| 102 | + <% end %> |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + <!-- Recently Viewed Libraries --> |
| 106 | + <div class="bg-white rounded-lg p-6 border border-gray-300"> |
| 107 | + <div class="flex justify-between items-center mb-4"> |
| 108 | + <h2 class="text-lg font-semibold text-gray-500 flex items-center"> |
| 109 | + <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
| 110 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25" /> |
| 111 | + </svg> |
| 112 | + Libraries |
| 113 | + </h2> |
| 114 | + <%= link_to libraries_path, class: "inline-flex items-center px-3 py-1 border border-sky-500 text-sky-500 text-sm font-medium rounded-md hover:bg-sky-500 hover:text-white transition-colors duration-200" do %> |
| 115 | + More |
| 116 | + <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
| 117 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /> |
| 118 | + </svg> |
| 119 | + <% end %> |
| 120 | + </div> |
| 121 | + <div class=""> |
| 122 | + <% if @recently_viewed_libraries.any? %> |
| 123 | + <% @recently_viewed_libraries.each do |library| %> |
| 124 | + <% viewed_item = library.viewed_items.find_by(user: current_user) %> |
| 125 | + <%= render "dashboard/list_item", |
| 126 | + path: library_path(library), |
| 127 | + title: library.name.truncate(50), |
| 128 | + subtitle: "Viewed #{time_ago_in_words(viewed_item.viewed_at)} ago" %> |
| 129 | + <% end %> |
| 130 | + <% else %> |
| 131 | + <p class="text-gray-400 italic">No recently viewed libraries</p> |
99 | 132 | <% end %> |
100 | 133 | </div> |
101 | 134 | </div> |
|
0 commit comments