Skip to content

Commit

Permalink
feat(bc): add ConstraintFields label options
Browse files Browse the repository at this point in the history
  • Loading branch information
hdinia committed Mar 27, 2024
1 parent 956fa22 commit 4016508
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ function Fields({ study }: Props) {
[t],
);

const operatorOptions = useMemo(
() =>
OPERATORS.map((operator) => ({
label: t(`study.modelization.bindingConst.operator.${operator}`),
value: operator,
})),
[t],
);

const timeStepOptions = useMemo(
() =>
TIME_STEPS.map((timeStep) => ({
label: t(`global.time.${timeStep}`),
value: timeStep,
})),
[t],
);

////////////////////////////////////////////////////////////////
// JSX
////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -66,15 +84,15 @@ function Fields({ study }: Props) {
label={t("study.modelization.bindingConst.type")}
size="small"
variant="outlined"
options={TIME_STEPS}
options={timeStepOptions}
control={control}
/>
<SelectFE
name="operator"
label={t("study.modelization.bindingConst.operator")}
size="small"
variant="outlined"
options={OPERATORS}
options={operatorOptions}
control={control}
/>
<SwitchFE
Expand Down

0 comments on commit 4016508

Please sign in to comment.