feishin/src/renderer/context/list-context.tsx

21 lines
528 B
TypeScript
Raw Normal View History

2023-07-19 13:48:34 -07:00
import { createContext, useContext } from 'react';
2023-07-19 13:48:34 -07:00
import { ListKey } from '/@/renderer/store';
2025-05-20 19:23:36 -07:00
import { Play } from '/@/shared/types/types';
2023-07-19 13:48:34 -07:00
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;
};