import React, { HTMLAttributes, ReactNode, FC } from 'react'; import classNames from '../../lib/classNames'; import getClassName from '../../helpers/getClassName'; import Tappable from '../Tappable/Tappable'; import Icon24Chevron from '@vkontakte/icons/dist/24/chevron'; import { HasRootRef } from '../../types'; import { IOS } from '../../lib/platform'; import usePlatform from '../../hooks/usePlatform'; export interface SimpleCellProps extends HTMLAttributes, HasRootRef { /** * Иконка 28 или `` */ before?: ReactNode; indicator?: ReactNode; /** * Иконка 24|28 или `` */ after?: ReactNode; description?: ReactNode; href?: string; target?: string; disabled?: boolean; expandable?: boolean; multiline?: boolean; } const SimpleCell: FC = ({ before, indicator, children, after, description, className, expandable, multiline, ...restProps }) => { const platform = usePlatform(); const hasAfter = after || expandable && platform === IOS; return ( {before} {children} {description && {description}} {indicator && {indicator} } {hasAfter && {after} {expandable && platform === IOS && } } ); }; export default SimpleCell;