Files
copilotkit__copilotkit/examples/v2/angular/storybook/components/custom-input.component.ts
Alem Tuzlak 79ce60c580 chore: migrate from eslint+prettier to oxlint+oxfmt
Replace eslint and prettier with oxlint and oxfmt for faster linting
and formatting across the monorepo. Remove all eslint and prettier
configs, dependencies, and related packages. Add .oxlintrc.json and
.oxfmtrc.json for the new tooling. Update CI workflows and lefthook
hooks accordingly. Reformat codebase with oxfmt.

https://claude.ai/code/session_01GMkSf29p78HuMR1mbXn8He
2026-04-02 16:39:05 +02:00

69 lines
1.5 KiB
TypeScript

import { Component, Input } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from "@angular/forms";
import { ChatState } from "@copilotkit/angular";
@Component({
selector: "custom-input",
standalone: true,
imports: [CommonModule, FormsModule],
template: `
<div
[class]="inputClass"
style="
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
padding: 20px;
border-radius: 15px;
margin: 10px;
"
>
<input
type="text"
[(ngModel)]="inputValue"
placeholder="💬 Ask me anything..."
style="
width: 100%;
padding: 15px;
border: 2px solid white;
border-radius: 10px;
font-size: 16px;
background: rgba(255, 255, 255, 0.9);
color: #333;
outline: none;
"
(keyup.enter)="handleSend()"
/>
<button
style="
margin-top: 10px;
padding: 10px 20px;
background: white;
color: #f5576c;
border: none;
border-radius: 5px;
font-weight: bold;
cursor: pointer;
"
(click)="handleSend()"
>
Send Message ✨
</button>
</div>
`,
})
export class CustomInputComponent {
@Input() inputClass?: string;
inputValue = "";
constructor(private chat: ChatState) {}
handleSend() {
const value = this.inputValue.trim();
if (value) {
this.chat.submitInput(value);
this.inputValue = "";
}
}
}