# All files / src/dialog DialogContainer.tsx

100% Statements 30/30
100% Branches 3/3
100% Functions 1/1
100% Lines 30/30

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    311x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    92x
    92x
    38x
    38x
    54x
    54x
    54x
    54x
    54x
    54x
    54x
     import { cnb } from "cnbuilder";
    import { type HTMLAttributes, type ReactElement, type ReactNode } from "react";

    /**
     * @remarks \@since 6.0.0
     * @internal
     */
    export interface DialogContainerProps extends HTMLAttributes<HTMLDivElement> {
      enabled: boolean;
      children: ReactNode;
    }

    /**
     * **Server Component**
     *
     * @remarks \@since 6.0.0
     * @internal
     */
    export function DialogContainer(props: DialogContainerProps): ReactElement {
      const { className, enabled, children, ...remaining } = props;
      if (!enabled) {
        return <>{children}</>;
      }

      return (
        <div {...remaining} className={cnb("rmd-dialog-container", className)}>
          {children}
        </div>
      );
    }