diff --git a/web/src/components/core/Section.jsx b/web/src/components/core/Section.jsx index c6323e6b54..c1954b7d4e 100644 --- a/web/src/components/core/Section.jsx +++ b/web/src/components/core/Section.jsx @@ -24,7 +24,7 @@ import React from "react"; import { Link } from "react-router-dom"; import { Icon } from '~/components/layout'; -import { ValidationErrors } from "~/components/core"; +import { If, ValidationErrors } from "~/components/core"; /** * Renders children into an HTML section @@ -48,7 +48,7 @@ import { ValidationErrors } from "~/components/core"; * @typedef { Object } SectionProps * @property {string} [icon] - Name of the section icon. Not rendered if title is not provided. * @property {string} [title] - The section title. If not given, aria-label must be provided. - * @property {string} [description] - A section description. Use only if really needed. + * @property {string|React.ReactElement} [description] - A section description. Use only if really needed. * @property {string} [name] - The section name. Used to build the header id. * @property {string} [path] - Path where the section links to. * when user clicks on the title, used for opening a dialog. @@ -86,13 +86,13 @@ export default function Section({ const iconName = loading ? "loading" : icon; const headerIcon = iconName ? : null; const headerText = !path?.trim() ? title : {title}; + const renderDescription = React.isValidElement(description) || description?.length > 0; return (

{headerIcon}{headerText}

-

{description}

+ {description}

} />
- ); };