feat: request portal — bespoke forms + approval mechanism
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import * as React from 'react';
|
||||
import { IRequestFormProps, RequestTypeId } from '../models/types';
|
||||
|
||||
type FormComponent = React.ComponentType<IRequestFormProps>;
|
||||
|
||||
/**
|
||||
* Реестр форм: id типа заявки → лениво загружаемая форма.
|
||||
* Каждая форма — отдельный чанк (React.lazy): в бандл первого экрана не попадает,
|
||||
* подтягивается только при открытии. Добавить форму = папка + строка здесь.
|
||||
*/
|
||||
const formRegistry: Record<string, React.LazyExoticComponent<FormComponent>> = {
|
||||
'recruiting-selection': React.lazy(
|
||||
() =>
|
||||
import(
|
||||
/* webpackChunkName: 'form-recruiting-selection' */ './RecruitingSelection/RecruitingSelectionForm'
|
||||
)
|
||||
),
|
||||
'recruiting-hire': React.lazy(
|
||||
() =>
|
||||
import(/* webpackChunkName: 'form-recruiting-hire' */ './RecruitingHire/RecruitingHireForm')
|
||||
)
|
||||
};
|
||||
|
||||
export function getFormComponent(
|
||||
id: RequestTypeId
|
||||
): React.LazyExoticComponent<FormComponent> | undefined {
|
||||
return formRegistry[id];
|
||||
}
|
||||
Reference in New Issue
Block a user