// Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import classNames from 'classnames'; import { bemGenerator } from './util'; export type Props = { alwaysShowActions?: boolean; className?: string; icon?: React.ReactNode; label: string | React.ReactNode; info?: string; right?: string | React.ReactNode; actions?: React.ReactNode; onClick?: () => void; }; const bem = bemGenerator('module-conversation-details-panel-row'); export const PanelRow: React.ComponentType = ({ alwaysShowActions, className, icon, label, info, right, actions, onClick, }) => { const content = ( <> {icon !== undefined ?
{icon}
: null}
{label}
{info !== undefined ?
{info}
: null}
{right !== undefined ?
{right}
: null} {actions !== undefined ? (
{actions}
) : null} ); if (onClick) { return ( ); } return
{content}
; };