chore: update env vars from backend version
This commit is contained in:
@@ -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;
|
||||
};
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user