From eaa8131f58e9a6cd8be2ee68bc48300947f4aee1 Mon Sep 17 00:00:00 2001 From: Troy Chryssos Date: Fri, 15 Nov 2024 19:37:00 -0800 Subject: [PATCH] show path if path exists --- .../sotww/inputs/PathInputs/PathInputs.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/rulebookSpecific/sotww/inputs/PathInputs/PathInputs.tsx b/src/components/rulebookSpecific/sotww/inputs/PathInputs/PathInputs.tsx index e6543ecc..c8008cde 100644 --- a/src/components/rulebookSpecific/sotww/inputs/PathInputs/PathInputs.tsx +++ b/src/components/rulebookSpecific/sotww/inputs/PathInputs/PathInputs.tsx @@ -16,16 +16,23 @@ const iconMap: Record = { export function PathInputs() { const { watch } = useFormContext(); - const level = watch('level'); const { isEditMode } = useContext(EditContext); + const expertPath = watch('path_expert'); + const expertPathDetails = watch('path_expert_benefits'); + const masterPath = watch('path_master'); + const masterPathDetails = watch('path_master_benefits'); + + const showExpert = Boolean(expertPath || expertPathDetails.length); + const showMaster = Boolean(masterPath || masterPathDetails.length); + return ( <> - {(level >= 3 || isEditMode) && ( + {(showExpert || isEditMode) && ( )} - {(level >= 7 || isEditMode) && ( + {(showMaster || isEditMode) && ( )}