forked from farhoodlabs/paperclip
fix(inbox): address Greptile review findings
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
export interface GeneralSettingsContextValue {
|
||||
keyboardShortcutsEnabled: boolean;
|
||||
}
|
||||
|
||||
const GeneralSettingsContext = createContext<GeneralSettingsContextValue>({
|
||||
keyboardShortcutsEnabled: false,
|
||||
});
|
||||
|
||||
export function GeneralSettingsProvider({
|
||||
value,
|
||||
children,
|
||||
}: {
|
||||
value: GeneralSettingsContextValue;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<GeneralSettingsContext.Provider value={value}>
|
||||
{children}
|
||||
</GeneralSettingsContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useGeneralSettings() {
|
||||
return useContext(GeneralSettingsContext);
|
||||
}
|
||||
Reference in New Issue
Block a user