feat(streamer): react views ported from prototype with sse hooks

This commit is contained in:
devilreef 2026-04-30 15:26:57 +06:00
parent 870a41a2f7
commit e0d93b03ae
Signed by: devilreef
SSH key fingerprint: SHA256:UZisRr4iuXx+IhkbZnR655L2RWAT6o2rgbGv5F/6m3Y
9 changed files with 672 additions and 0 deletions

View file

@ -0,0 +1,14 @@
export const fmtMs = (sec: number): string => {
const m = Math.floor(sec / 60);
const s = Math.floor(sec % 60);
return `${m}:${s.toString().padStart(2, "0")}`;
};
export const fmtClock = (d: Date): string =>
`${d.getHours().toString().padStart(2, "0")}:${d.getMinutes().toString().padStart(2, "0")}`;
export const fmtClockSec = (d: Date): string =>
`${fmtClock(d)}:${d.getSeconds().toString().padStart(2, "0")}`;
export const fmtJpDate = (d: Date): string =>
`${d.getFullYear()}${d.getMonth() + 1}${d.getDate()}`;