mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-13 07:43:43 +08:00
26 lines
529 B
TypeScript
26 lines
529 B
TypeScript
/**
|
|
* TVContext
|
|
* Provides TV mode detection to the entire app.
|
|
*/
|
|
|
|
'use client';
|
|
|
|
import { createContext, useContext, type ReactNode } from 'react';
|
|
import { useTVDetection } from '@/lib/hooks/useTVDetection';
|
|
|
|
const TVContext = createContext(false);
|
|
|
|
export function TVProvider({ children }: { children: ReactNode }) {
|
|
const isTV = useTVDetection();
|
|
|
|
return (
|
|
<TVContext.Provider value={isTV}>
|
|
{children}
|
|
</TVContext.Provider>
|
|
);
|
|
}
|
|
|
|
export function useIsTV(): boolean {
|
|
return useContext(TVContext);
|
|
}
|