Add generic list context

This commit is contained in:
jeffvli 2023-07-19 13:48:34 -07:00
parent 4029127018
commit 9bcefb3105

View file

@ -0,0 +1,19 @@
import { createContext, useContext } from 'react';
import { ListKey } from '/@/renderer/store';
import { Play } from '/@/renderer/types';
interface ListContextProps {
customFilters?: Record<string, unknown>;
handlePlay?: (args: { initialSongId?: string; playType: Play }) => void;
id?: string;
pageKey: ListKey;
}
export const ListContext = createContext<ListContextProps>({
pageKey: '',
});
export const useListContext = () => {
const ctxValue = useContext(ListContext);
return ctxValue;
};