mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 00:04:49 +00:00
Make entire collapsible header clickable
- Changed outer div to button element - Added w-full and text-left classes - Now click anywhere on header (icon, text, chevron) to expand/collapse
This commit is contained in:
parent
f646a29d1a
commit
1405c47b50
1 changed files with 5 additions and 7 deletions
|
|
@ -98,17 +98,15 @@ export function renderCollapsibleHeader(
|
||||||
: "text-foreground";
|
: "text-foreground";
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="flex items-center justify-between gap-2 text-sm text-muted-foreground">
|
<button @click=${toggleContent} class="flex items-center justify-between gap-2 text-sm text-muted-foreground w-full text-left hover:text-foreground transition-colors">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
${state === "inprogress" ? statusIcon(Loader, "text-foreground animate-spin") : ""}
|
${state === "inprogress" ? statusIcon(Loader, "text-foreground animate-spin") : ""}
|
||||||
${statusIcon(toolIcon, toolIconColor)}
|
${statusIcon(toolIcon, toolIconColor)}
|
||||||
<span>${text}</span>
|
<span>${text}</span>
|
||||||
</div>
|
</div>
|
||||||
<button @click=${toggleContent} class="hover:text-foreground transition-colors">
|
<span class="inline-block text-muted-foreground" ${ref(chevronRef)}>
|
||||||
<span class="inline-block text-muted-foreground" ${ref(chevronRef)}>
|
${icon(defaultExpanded ? ChevronDown : ChevronRight, "sm")}
|
||||||
${icon(defaultExpanded ? ChevronDown : ChevronRight, "sm")}
|
</span>
|
||||||
</span>
|
</button>
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue