mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
feat(chat): tailor replies for mobile and text-to-speech
This commit is contained in:
1 parent
b140a9c77b
commit
b974618dee
7 files changed
+204
-7
No files matched your search
@@ -1,12 +1,16 @@
|
||||
import { useState, useEffect, useCallback, useRef, type CSSProperties } from 'react'
|
||||
import { useSwipeNavigation } from '@/contexts/SwipeNavigationContext'
|
||||
|
||||
export function isMobileViewport(): boolean {
|
||||
return typeof window !== 'undefined' ? window.innerWidth < 768 : false
|
||||
}
|
||||
|
||||
export function useMobile() {
|
||||
const [isMobile, setIsMobile] = useState(() => (typeof window !== 'undefined' ? window.innerWidth < 768 : false))
|
||||
const [isMobile, setIsMobile] = useState(isMobileViewport)
|
||||
|
||||
useEffect(() => {
|
||||
const checkMobile = () => {
|
||||
setIsMobile(window.innerWidth < 768)
|
||||
setIsMobile(isMobileViewport())
|
||||
}
|
||||
|
||||
checkMobile()
|
||||
|
||||
Reference in new issue
Block a user