blob: a861a073add8b17aed14c99924bf4f55c3e1daea [file] [log] [blame]
banksean333aa672025-07-13 19:49:21 +00001import { html } from "lit";
Josh Bleecher Snyder2d081192025-05-29 13:46:04 +00002import { customElement, property } from "lit/decorators.js";
3import { ToolCall } from "../types";
banksean333aa672025-07-13 19:49:21 +00004import { SketchTailwindElement } from "./sketch-tailwind-element";
5import "./sketch-tool-card-base";
Josh Bleecher Snyder2d081192025-05-29 13:46:04 +00006
7@customElement("sketch-tool-card-browser-clear-console-logs")
banksean333aa672025-07-13 19:49:21 +00008export class SketchToolCardBrowserClearConsoleLogs extends SketchTailwindElement {
Josh Bleecher Snyder2d081192025-05-29 13:46:04 +00009 @property()
10 toolCall: ToolCall;
11
12 @property()
13 open: boolean;
14
Josh Bleecher Snyder2d081192025-05-29 13:46:04 +000015 render() {
banksean1ee0bc62025-07-22 23:24:18 +000016 const summaryContent = html`<span
17 class="font-mono text-gray-700 dark:text-gray-300 break-all"
18 >
banksean333aa672025-07-13 19:49:21 +000019 🧹 Clear console logs
20 </span>`;
21 const inputContent = html`<div>Clear all console logs</div>`;
22 const resultContent = this.toolCall?.result_message?.tool_result
23 ? html`<pre
banksean1ee0bc62025-07-22 23:24:18 +000024 class="bg-gray-200 dark:bg-gray-700 text-black dark:text-gray-100 p-2 rounded whitespace-pre-wrap break-words max-w-full w-full box-border"
banksean333aa672025-07-13 19:49:21 +000025 >
26${this.toolCall.result_message.tool_result}</pre
27 >`
28 : "";
29
Josh Bleecher Snyder2d081192025-05-29 13:46:04 +000030 return html`
banksean333aa672025-07-13 19:49:21 +000031 <sketch-tool-card-base
32 .open=${this.open}
33 .toolCall=${this.toolCall}
34 .summaryContent=${summaryContent}
35 .inputContent=${inputContent}
36 .resultContent=${resultContent}
37 >
38 </sketch-tool-card-base>
Josh Bleecher Snyder2d081192025-05-29 13:46:04 +000039 `;
40 }
41}
42
43declare global {
44 interface HTMLElementTagNameMap {
45 "sketch-tool-card-browser-clear-console-logs": SketchToolCardBrowserClearConsoleLogs;
46 }
47}