From 327369201b44758fee148295c36836c50ec3a741 Mon Sep 17 00:00:00 2001 From: Gyeongho Yang Date: Tue, 5 Nov 2024 22:54:57 +0900 Subject: [PATCH] feat: disable selected condition option name --- .../src/pages/enhance/6-execute/potential/autoModal.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/src/pages/enhance/6-execute/potential/autoModal.tsx b/frontend/src/pages/enhance/6-execute/potential/autoModal.tsx index 2ca4a06..32a93a8 100644 --- a/frontend/src/pages/enhance/6-execute/potential/autoModal.tsx +++ b/frontend/src/pages/enhance/6-execute/potential/autoModal.tsx @@ -197,6 +197,9 @@ export default function AutoModal({ grades: condition.grades, }} options={selectOptions} + isOptionDisabled={(option) => + conditions.some(({ name }) => name == option.label) + } onChange={(option) => { if (!option) { if (onDelete) onDelete(i); @@ -251,6 +254,9 @@ export default function AutoModal({ size="sm" components={components} options={selectOptions} + isOptionDisabled={(option) => + (conditions ?? []).some(({ name }) => name == option.label) + } onChange={(option) => { if (!onCreate || !option) return; const infosByName = conditionInfos[option.label];