diff --git a/web/src/features/fba/components/map/Legend.tsx b/web/src/features/fba/components/map/Legend.tsx index 23ffe9193..07638511e 100644 --- a/web/src/features/fba/components/map/Legend.tsx +++ b/web/src/features/fba/components/map/Legend.tsx @@ -39,48 +39,58 @@ interface LegendItemProps { onChange: (event: React.ChangeEvent, checked: boolean) => void subItems?: SubItem[] description?: string | null + renderEmptyDescription?: boolean } -const LegendItem: React.FC = ({ label, checked, onChange, subItems, description }) => ( -
- - - - - - - - {label} - +const LegendItem: React.FC = ({ + label, + checked, + onChange, + subItems, + description, + renderEmptyDescription = false +}) => { + return ( +
+ + + + + + + + {label} + + - - - - - {description} - + + + + {description ?? (renderEmptyDescription &&  )} + + - - {subItems && ( - - {subItems.map(subItem => ( - - - - - {subItem.label} - - ))} - - )} - -
-) + {subItems && ( + + {subItems.map(subItem => ( + + + + + {subItem.label} + + ))} + + )} +
+
+ ) +} interface LegendProps { onToggleLayer: (layerName: string, isVisible: boolean) => void @@ -143,6 +153,7 @@ const Legend = ({ checked={showSnow} onChange={() => handleLayerChange('snowVector', showSnow, setShowSnow)} description={snowDescription} + renderEmptyDescription={true} > )