import React, { memo } from 'react' import { Icon, IconProps } from './Icon' import { Scale } from './Scale' import { getSize } from './Sizes' import { SimpleText, SimpleTextProps } from './text/SimpleText' import { Stack, StackProps } from './View/Stack' export type IconLabeledProps = StackProps & { icon?: React.ReactNode label?: string labelProps?: SimpleTextProps subTitle?: string subTitleProps?: SimpleTextProps iconProps?: IconProps } export const IconLabeled = memo( ({ icon, label, labelProps, subTitle, size = 1, subTitleProps, iconProps, ...restProps }: IconLabeledProps) => { const sizeNum = getSize(size) return ( {typeof icon === 'string' ? ( ) : ( icon )} {!!label && ( {label} )} {!!subTitle && ( {subTitle} )} ) }, )