mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
20 lines
528 B
TypeScript
20 lines
528 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
import { ListKey } from '/@/renderer/store';
|
|
import { Play } from '/@/shared/types/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;
|
|
};
|