feat: add moduleType to configurations, introduce DetailPageProvider, and consolidate macOS detection into module provider context
This commit is contained in:
@@ -1,20 +1,10 @@
|
||||
import { createContext, useContext } from 'react';
|
||||
import type { BaseEntity } from '@repo/core-api/data-services';
|
||||
|
||||
export interface IndexPageContextValue<E extends BaseEntity = BaseEntity> {
|
||||
_data?: E; // Fix unused generic
|
||||
// renderRowActions: (row: E) => React.ReactNode;
|
||||
// refreshGrid: () => void;
|
||||
// // State for batch modals
|
||||
// isConfirmModalOpen: boolean;
|
||||
// setIsConfirmModalOpen: (open: boolean) => void;
|
||||
// isDeleteModalOpen: boolean;
|
||||
// setIsDeleteModalOpen: (open: boolean) => void;
|
||||
}
|
||||
export interface IndexPageContextValue {}
|
||||
|
||||
export const IndexPageContext = createContext<IndexPageContextValue<any> | null>(null);
|
||||
export const IndexPageContext = createContext<IndexPageContextValue | null>(null);
|
||||
|
||||
export function useIndexPageContext<E extends BaseEntity = BaseEntity>(): IndexPageContextValue<E> {
|
||||
export function useIndexPageContext(): IndexPageContextValue {
|
||||
const context = useContext(IndexPageContext);
|
||||
if (!context) {
|
||||
throw new Error('useIndexPageContext must be used within an IndexPageProvider');
|
||||
|
||||
Reference in New Issue
Block a user