feat: add moduleType to configurations, introduce DetailPageProvider, and consolidate macOS detection into module provider context

This commit is contained in:
Firman Ramdhani
2026-07-13 15:39:10 +07:00
parent 0bbd376125
commit 383e2627e0
7 changed files with 41 additions and 41 deletions
@@ -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');