import React, { FC } from 'react' import styled, { css } from 'styled-components' import { AppName, Colors, flexFlow, FontSizes, getColor, isAppName, typographyFont, } from '@monorail/helpers/exports' import { isEmptyString } from '@monorail/sharedHelpers/typeGuards' import { AppIcon } from '@monorail/visualComponents/appIcon/AppIcon' import { Icon } from '@monorail/visualComponents/icon/Icon' import { IconType } from '@monorail/visualComponents/icon/IconType' import { Text } from '@monorail/visualComponents/typography/Text' const SectionHeaderContainer = styled.div` ${flexFlow('row')}; ${typographyFont(700, FontSizes.Title5)}; align-items: center; color: ${getColor(Colors.Black74a)}; flex-shrink: 0; height: 40px; padding: 0 16px; ` const iconLeftStyle = css` margin-right: 8px; ` const iconRightStyle = css` margin-left: 8px; ` type Props = { title: string iconLeft?: IconType | AppName iconRight?: IconType | AppName } export const SectionHeader: FC = props => { const { children, iconLeft = '', iconRight = '', title, ...otherProps } = props return ( {!isEmptyString(iconLeft) && (isAppName(iconLeft) ? ( ) : ( ))} {title} {!isEmptyString(iconRight) && (isAppName(iconRight) ? ( ) : ( ))} {children} ) }