added rankings but ugly and tired

This commit is contained in:
2025-10-13 16:44:48 +02:00
parent 1139cfd5f0
commit 174e3e94ed
18 changed files with 721 additions and 51 deletions

View File

@@ -0,0 +1,22 @@
// hooks/useTerminalSize.js
import { useState, useEffect } from 'react';
import { useStdout } from 'ink';
export function useTerminalSize() {
const { stdout } = useStdout();
const [size, setSize] = useState({ width: stdout.columns, height: stdout.rows });
useEffect(() => {
if (!stdout) return;
function onResize() {
setSize({ width: stdout.columns, height: stdout.rows });
}
stdout.on('resize', onResize);
return () => {
stdout.off('resize', onResize);
};
}, [stdout]);
return size;
}