chore: providers ux

This commit is contained in:
jialin
2026-02-03 18:21:08 +08:00
parent b2a8d27178
commit e8e982559d
32 changed files with 469 additions and 128 deletions
@@ -0,0 +1,19 @@
import { PageActionType } from '@/config/types';
import { createContext, useContext } from 'react';
interface FormContextProps {
providerType?: string;
action?: PageActionType;
}
const FormContext = createContext<FormContextProps>({});
export const useFormContext = () => {
const context = useContext(FormContext);
if (!context) {
throw new Error('useFormContext must be used within a FormProvider');
}
return context;
};
export default FormContext;