|
18 | 18 | data-role="assistant"
|
19 | 19 | data-radio-behavior-target="radio"
|
20 | 20 | data-action="radio-changed@window->radio-behavior#select"
|
21 |
| - data-radio-behavior-id-param="<%= assistant.id %>" |
22 |
| - data-transition-target="<%= !visible && 'transitionable' %>" |
| 21 | + data-radio-behavior-id-param="<%= assistant.id %>" |
| 22 | + data-transition-target="<%= !visible && 'transitionable' %>" |
23 | 23 | >
|
24 |
| - <%= link_to new_assistant_message_path(assistant), class: "flex-1 flex py-1 items-center text-gray-950 dark:text-gray-100 font-medium truncate", data: { role: "name" } do %> |
25 |
| - <%= render partial: "layouts/assistant_avatar", locals: { assistant: assistant, size: 7, classes: "mr-2" } %> |
26 |
| - <%= assistant.name %> |
27 |
| - <% end %> |
28 |
| - <div class="hidden gap-3 pl-2 relationship:flex group-hover:flex"> |
29 |
| - <% if settings %> |
30 |
| - <div class="inline-flex outline-none dropdown dropdown-end"> |
31 |
| - <%= icon "ellipsis-horizontal", |
32 |
| - tabindex: 0, |
33 |
| - role: :button, |
34 |
| - variant: :micro, |
| 24 | + <% if assistant.api_service.effective_token? %> |
| 25 | + <%= link_to new_assistant_message_path(assistant), class: "flex items-center py-1 text-gray-950 dark:text-gray-100 font-medium truncate", data: { role: "name" } do %> |
| 26 | + <div class="relative inline-block w-7 h-7 mr-2"> |
| 27 | + <%= render partial: "layouts/assistant_avatar", locals: { assistant:, size: 7 } %> |
| 28 | + </div> |
| 29 | + <%= assistant.name %> |
| 30 | + <% end %> |
| 31 | + <div class="hidden gap-3 pl-2 relationship:flex group-hover:flex"> |
| 32 | + <% if settings %> |
| 33 | + <div class="inline-flex outline-none dropdown dropdown-end"> |
| 34 | + <%= icon "ellipsis-horizontal", |
| 35 | + tabindex: 0, |
| 36 | + role: :button, |
| 37 | + variant: :micro, |
| 38 | + size: 18, |
| 39 | + class: "outline-none text-gray-950 dark:text-gray-100 invisible group-hover:visible cursor-pointer", |
| 40 | + data: { controller: "nested-pointer" }, |
| 41 | + title: "More" |
| 42 | + %> |
| 43 | + <menu tabindex="0" class="dropdown-content z-10 menu p-2 shadow-xl bg-base-100 rounded-box w-52 -mr-10 mt-7 dark:!bg-gray-700" data-controller="nested-pointer"> |
| 44 | + <li><%= link_to edit_settings_assistant_path(assistant) do %><%= icon "cog-6-tooth", variant: :outline, size: 18 %>Settings<% end %></li> |
| 45 | + <!-- <li><a><%= icon "arrow-up-tray", variant: :outline, size: 18 %>Share</a></li> --> |
| 46 | + </menu> |
| 47 | + </div> |
| 48 | + <% end %> |
| 49 | + <%= link_to new_assistant_message_path(assistant), class: "inline-flex", data: { role: "new" } do %> |
| 50 | + <%= icon "pencil-square", |
| 51 | + variant: :outline, |
35 | 52 | size: 18,
|
36 |
| - class: "outline-none text-gray-950 dark:text-gray-100 invisible group-hover:visible cursor-pointer", |
37 |
| - 'data-controller': "nested-pointer", |
38 |
| - title: "More" |
| 53 | + class: "text-gray-950 dark:text-gray-100 cursor-pointer group-hover:visible invisible |
| 54 | + relationship:visible relationship:text-gray-950 dark:relationship:text-gray-100", |
| 55 | + data: { controller: "nested-pointer" }, |
| 56 | + title: "New" |
39 | 57 | %>
|
40 |
| - <menu tabindex="0" class="dropdown-content z-10 menu p-2 shadow-xl bg-base-100 rounded-box w-52 -mr-10 mt-7 dark:!bg-gray-700" data-controller="nested-pointer"> |
41 |
| - <li><%= link_to edit_settings_assistant_path(assistant) do %><%= icon "cog-6-tooth", variant: :outline, size: 18 %>Settings<% end %></li> |
42 |
| - <!-- <li><a><%= icon "arrow-up-tray", variant: :outline, size: 18 %>Share</a></li> --> |
43 |
| - </menu> |
| 58 | + <% end %> |
| 59 | + </div> |
| 60 | + <% else %> |
| 61 | + <%= link_to edit_settings_api_service_path(assistant.api_service), class: "flex items-center py-1 text-gray-950 dark:text-gray-100 font-medium truncate", data: { role: "name" } do %> |
| 62 | + <div class="relative inline-block w-7 h-7 mr-2"> |
| 63 | + <%= render partial: "layouts/assistant_avatar", locals: { assistant:, size: 7 } %> |
| 64 | + <div class="absolute -bottom-1 right-0 bg-gray-50 dark:bg-gray-900 px-px py-[2px] rounded-full"> |
| 65 | + <%= icon "lock-closed", variant: :outline, size: 12, class: "text-gray-950 dark:text-gray-100" %> |
| 66 | + </div> |
44 | 67 | </div>
|
| 68 | + <%= assistant.name %> |
45 | 69 | <% end %>
|
46 |
| - <%= link_to new_assistant_message_path(assistant), class: "inline-flex", data: { role: "new" } do %> |
47 |
| - <%= icon "pencil-square", |
48 |
| - variant: :outline, |
49 |
| - size: 18, |
50 |
| - class: "text-gray-950 dark:text-gray-100 cursor-pointer group-hover:visible invisible |
51 |
| - relationship:visible relationship:text-gray-950 dark:relationship:text-gray-100", |
52 |
| - 'data-controller': "nested-pointer", |
53 |
| - title: "New" |
54 |
| - %> |
55 |
| - <% end %> |
56 |
| - </div> |
| 70 | + <% end %> |
57 | 71 | </div>
|
58 | 72 | </div>
|
0 commit comments