goldenChat base source add

This commit is contained in:
aidev
2026-05-23 15:11:48 +09:00
commit a4ea7762b5
2081 changed files with 1155760 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { useEffect, useState } from 'react';
/** CSS 미디어 쿼리 매칭 여부 (모바일·태블릿 분기용) */
export function useMediaQuery(query: string): boolean {
const [matches, setMatches] = useState(() => {
if (typeof window === 'undefined') return false;
return window.matchMedia(query).matches;
});
useEffect(() => {
const mq = window.matchMedia(query);
const onChange = () => setMatches(mq.matches);
onChange();
mq.addEventListener('change', onChange);
return () => mq.removeEventListener('change', onChange);
}, [query]);
return matches;
}
/** 차트 메인 레이아웃 모바일 분기 (≤768px) */
export function useIsMobile(): boolean {
return useMediaQuery('(max-width: 768px)');
}