import React, { FunctionComponent, HTMLAttributes, ReactNode } from 'react'; import getClassName from '../../helpers/getClassName'; import classNames from '../../lib/classNames'; import usePlatform from '../../hooks/usePlatform'; import { HasRef } from '../../types'; export interface ModalPageHeaderProps extends HTMLAttributes, HasRef { /** * Иконки, отображаемые слева */ left?: ReactNode; /** * Иконки, отображаемые справа */ right?: ReactNode; noShadow?: boolean; } const ModalPageHeader: FunctionComponent = (props: ModalPageHeaderProps) => { const platform = usePlatform(); const { className, left, right, children, noShadow, getRef } = props; const isPrimitive = typeof children === 'string' || typeof children === 'number'; return (
{left}
{isPrimitive ? {children} : children}
{right}
{!noShadow &&
}
); }; export default ModalPageHeader;