fix: resolve all ESLint errors blocking CI releases

- Extract ThemeContext and ToolCollapseContext definitions into separate
  files to satisfy react-refresh/only-export-components rule
- Move useTheme and useToolCollapse hooks to dedicated hook files
- Fix empty catch block in ThemeContext (add comment)
- Replace Date.now() ref in ThinkingIndicator with useState initializer
- Update all imports across components

Closes feedback #58
This commit is contained in:
Nicolas Varrot
2026-02-13 00:13:12 +00:00
parent 8ab4f83666
commit 73a46f3ba7
11 changed files with 108 additions and 50 deletions

View File

@@ -1,4 +1,4 @@
import { useState, useEffect, useRef } from 'react';
import { useState, useEffect } from 'react';
import { Brain } from 'lucide-react';
import { useT } from '../hooks/useLocale';
@@ -10,14 +10,14 @@ import { useT } from '../hooks/useLocale';
export function ThinkingIndicator() {
const t = useT();
const [elapsed, setElapsed] = useState(0);
const startRef = useRef(Date.now());
const [start] = useState(() => Date.now());
useEffect(() => {
const interval = setInterval(() => {
setElapsed(Math.floor((Date.now() - startRef.current) / 1000));
setElapsed(Math.floor((Date.now() - start) / 1000));
}, 1000);
return () => clearInterval(interval);
}, []);
}, [start]);
const formatElapsed = (s: number) => {
if (s < 60) return `${s}s`;