Files
sproutclaw/packages/coding-agent/src/tui/dynamic-border.ts
Mario Zechner 85adcf22bf Release v0.8.0
2025-11-21 03:12:42 +01:00

22 lines
534 B
TypeScript

import type { Component } from "@mariozechner/pi-tui";
import { theme } from "../theme/theme.js";
/**
* Dynamic border component that adjusts to viewport width
*/
export class DynamicBorder implements Component {
private color: (str: string) => string;
constructor(color: (str: string) => string = (str) => theme.fg("border", str)) {
this.color = color;
}
invalidate(): void {
// No cached state to invalidate currently
}
render(width: number): string[] {
return [this.color("─".repeat(Math.max(1, width)))];
}
}