2023-07-19 13:48:34 -07:00
|
|
|
import { createContext, useContext } from 'react';
|
2025-05-18 14:03:18 -07:00
|
|
|
|
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;
|
|
|
|
|
};
|