forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopilot-chat-message-view-cursor.ts
More file actions
35 lines (33 loc) · 997 Bytes
/
Copy pathcopilot-chat-message-view-cursor.ts
File metadata and controls
35 lines (33 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {
Component,
input,
ChangeDetectionStrategy,
ViewEncapsulation,
computed,
} from "@angular/core";
import { CommonModule } from "@angular/common";
import { cn } from "../../utils";
/**
* Cursor component that matches the React implementation exactly.
* Shows a pulsing dot animation to indicate activity.
*/
@Component({
selector: "copilot-chat-message-view-cursor",
standalone: true,
imports: [CommonModule],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: `
<div data-testid="copilot-loading-cursor" [class]="computedClass()"></div>
`,
})
export class CopilotChatMessageViewCursor {
inputClass = input<string | undefined>();
// Computed class that matches React exactly: w-[11px] h-[11px] rounded-full bg-foreground animate-pulse-cursor ml-1
computedClass = computed(() =>
cn(
"w-[11px] h-[11px] rounded-full bg-foreground animate-pulse-cursor ml-1",
this.inputClass(),
),
);
}