/** * Copyright IBM Corp. 2021, 2024 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React, { ElementType, PropsWithChildren, ReactNode } from 'react'; interface WrapProps extends PropsWithChildren { /** * Specify whether the wrapper element should render even if there are no * children or the children are themselves empty wrappers. Useful if there * are some conditions in which the wrapper element is still required. Note * that this prop takes precedence over neverRender if both are set to true. */ alwaysRender?: boolean | null; /** * The element name or component to use as a wrapper for the content. */ element?: (() => ReactNode) | string | ElementType; /** * Specify whether nothing should be rendered even if there are children * in the content. Useful if there are some circumstances in which the * component should not render at all. Note that if alwaysRender is also * set to true then it will take precedence and the wrapper element and * content will be rendered. */ neverRender?: boolean; className?: string; /** * Tab index for the wrapper div */ tabIndex?: number; /** * The title attribute the content. */ title?: string; } /** * A simple conditional wrapper that encloses its children in a