mirror of
https://github.com/sct/overseerr.git
synced 2025-12-27 00:34:56 +01:00
22 lines
518 B
TypeScript
22 lines
518 B
TypeScript
import React from 'react';
|
|
import useInteraction from '../hooks/useInteraction';
|
|
|
|
interface InteractionContextProps {
|
|
isTouch?: boolean;
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
export const InteractionContext = React.createContext<InteractionContextProps>({
|
|
isTouch: false,
|
|
});
|
|
|
|
export const InteractionProvider = ({ children }: InteractionContextProps) => {
|
|
const isTouch = useInteraction();
|
|
|
|
return (
|
|
<InteractionContext.Provider value={{ isTouch }}>
|
|
{children}
|
|
</InteractionContext.Provider>
|
|
);
|
|
};
|