github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/ui/src/views/shared/components/pageconfig/index.tsx (about)

     1  // Copyright 2018 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  import classnames from "classnames";
    12  import React from "react";
    13  
    14  export interface PageConfigProps {
    15    layout?: "list" | "spread";
    16    children?: React.ReactNode;
    17  }
    18  
    19  export function PageConfig(props: PageConfigProps) {
    20    const classes = classnames({
    21      "page-config__list": props.layout !== "spread",
    22      "page-config__spread": props.layout === "spread",
    23    });
    24  
    25    return (
    26      <div className="page-config">
    27        <ul className={ classes }>
    28          { props.children }
    29        </ul>
    30      </div>
    31    );
    32  }
    33  
    34  export interface PageConfigItemProps {
    35    children?: React.ReactNode;
    36  }
    37  
    38  export function PageConfigItem(props: PageConfigItemProps) {
    39    return (
    40      <li className="page-config__item">
    41        { props.children }
    42      </li>
    43    );
    44  }