feat: implement full page components and validation schema; enhance translations and form handling

This commit is contained in:
Firman Ramdhani
2026-07-27 11:52:40 +07:00
parent db1abcbdd4
commit 5f97c6b2b0
16 changed files with 131 additions and 43 deletions
@@ -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',