feat: implement full page components and validation schema; enhance translations and form handling
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { createContext, useContext } from 'react';
|
||||
import type { BaseEntity } from '@repo/core-api/data-services';
|
||||
import { FormPageType } from '../entities/entity';
|
||||
import { UseFormReturn } from 'react-hook-form';
|
||||
export interface FormPageContextValue<E extends BaseEntity = BaseEntity> {
|
||||
formControl: UseFormReturn<any>;
|
||||
formType: FormPageType;
|
||||
isCreate: boolean;
|
||||
isEdit: boolean;
|
||||
|
||||
@@ -2,8 +2,11 @@ export * from './constant/';
|
||||
|
||||
export * from './entities/entity';
|
||||
|
||||
export * from './hooks/use-module.context';
|
||||
export * from './hooks/use-detail-page.context';
|
||||
export * from './hooks/use-form-draft.context';
|
||||
export * from './hooks/use-form-page.context';
|
||||
export * from './hooks/use-index-page.context';
|
||||
export * from './hooks/use-module.context';
|
||||
|
||||
export * from './providers/module.provider';
|
||||
export * from './providers/index-page.provider';
|
||||
|
||||
@@ -336,6 +336,7 @@ export function EnterpriseFormPageProvider<E extends BaseEntity = BaseEntity>(pr
|
||||
const contextValue = useMemo(
|
||||
() => ({
|
||||
formType: formPageType,
|
||||
formControl: formControl,
|
||||
isCreate: formPageType === 'CREATE',
|
||||
isEdit: formPageType === 'EDIT',
|
||||
isDuplicate: formPageType === 'DUPLICATE',
|
||||
|
||||
Reference in New Issue
Block a user