chore: update env vars from backend version

This commit is contained in:
jialin
2026-01-30 20:48:55 +08:00
committed by Lawrence Li
parent 4000aacb2c
commit 4a4a02eb0d
18 changed files with 240 additions and 116 deletions
+19
View File
@@ -0,0 +1,19 @@
import { PageActionType } from '@/config/types';
import { createContext, useContext } from 'react';
interface FormContextProps {
action: PageActionType;
backendSource: string;
}
export const FormContext = createContext<FormContextProps | null>(
{} as FormContextProps
);
export const useFormContext = () => {
const context = useContext(FormContext);
if (!context) {
throw new Error('useFormContext must be used within a FormContextProvider');
}
return context;
};
+18
View File
@@ -49,6 +49,24 @@ export const TagColorMap: Record<string, string> = {
[BackendSourceValueMap.COMMUNITY]: 'cyan'
};
export const backendSourceOptions = [
{
label: BackendSourceLabelMap[BackendSourceValueMap.BUILTIN],
value: BackendSourceValueMap.BUILTIN,
locale: true
},
{
label: BackendSourceLabelMap[BackendSourceValueMap.COMMUNITY],
value: BackendSourceValueMap.COMMUNITY,
locale: true
},
{
label: BackendSourceLabelMap[BackendSourceValueMap.CUSTOM],
value: BackendSourceValueMap.CUSTOM,
locale: true
}
];
export const backendActions = [
{
label: 'common.button.edit',