TEXT: String,
TEXT_AREA: TextArea,
YES_NO: Boolean,
SIMPLE_SELECT: Simple,
MULTI_SELECT: Multi,
FILE: File,
IMAGE: Image,
DATE: Date,
NUMBER: Number,
};
или
const images: Partial<Record<CH_TYPE_CODE, FunctionComponent>> = {
TEXT: String,
TEXT_AREA: TextArea,
YES_NO: Boolean,
SIMPLE_SELECT: Simple,
MULTI_SELECT: Multi,
FILE: File,
IMAGE: Image,
DATE: Date,
NUMBER: Number,
};
Лучше as const
Обсуждают сегодня