/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import "./drawer-item.scss"; import React from "react"; import { cssNames, displayBooleans } from "../../utils"; export interface DrawerItemProps extends React.HTMLAttributes { name: React.ReactNode; className?: string; title?: string; labelsOnly?: boolean; hidden?: boolean; renderBoolean?: boolean; // show "true" or "false" for all of the children elements are "typeof boolean" } export class DrawerItem extends React.Component { render() { const { name, title, labelsOnly, children, hidden, className, renderBoolean, ...elemProps } = this.props; if (hidden) return null; const classNames = cssNames("DrawerItem", className, { labelsOnly }); const content = displayBooleans(renderBoolean, children); return (
{name} {content}
); } }