refactor: enhance message streaming and UI components; add SWR provider

This commit is contained in:
asepharyana
2026-08-26 16:51:46 +07:00
parent 37d15456dc
commit b640079cb6
7 changed files with 110 additions and 113 deletions
-13
View File
@@ -4,16 +4,3 @@ import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
/**
* Returns an inline style that staggers a list item's entrance animation.
* Pair with the `animate-stagger` class. Caps the delay so long lists still
* appear promptly.
*/
export function staggerDelay(
index: number,
step = 45,
max = 600,
): React.CSSProperties {
return { animationDelay: `${Math.min(index * step, max)}ms` };
}
+2 -1
View File
@@ -1,6 +1,7 @@
import type { WsEventType } from "./ws/types";
import type { WsEventType, WsStatus } from "./ws/types";
export type WsHook = {
status?: WsStatus;
on: <E extends WsEventType>(
eventType: E,
handler: (data: unknown) => void,