mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 12:30:12 +02:00
21 lines
528 B
TypeScript
21 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;
|
|
};
|