Files
copilotkit__copilotkit/examples/v2/angular/storybook/components/custom-send-button.component.ts
2026-08-21 15:18:03 +02:00

33 lines
748 B
TypeScript

import {
Component,
EventEmitter,
Input,
Output,
ChangeDetectionStrategy,
} from "@angular/core";
@Component({
selector: "custom-send-button",
standalone: true,
changeDetection: ChangeDetectionStrategy.Eager,
template: `
<button
[disabled]="disabled"
(click)="handleClick()"
class="cpk:rounded-full cpk:w-10 cpk:h-10 cpk:bg-blue-500 cpk:text-white cpk:hover:bg-blue-600 cpk:transition-colors cpk:mr-2 cpk:disabled:opacity-50 cpk:disabled:cursor-not-allowed"
>
✈️
</button>
`,
})
export class CustomSendButtonComponent {
@Input() disabled = false;
@Output() clicked = new EventEmitter<void>();
handleClick(): void {
if (!this.disabled) {
this.clicked.emit();
}
}
}