import { HTMLAttributes } from 'react'; import { RtSegmentProps, RtSegmentSize } from './types/rt-segment.types'; import { RtFrame } from '@dpa/react-frame-intro'; import { RtText } from '@dpa/react-text'; import styles from './styles/rt-segment.module.css'; import classnames from 'classnames/bind'; import { useRtBaseProps } from '@dpa/react-hoc'; import { RtBaseProps } from '@dpa/react-hoc'; const cn = classnames.bind(styles); const mapTextSize: Record = { sm: 'sm', md: 'sm', lg: 'md', }; export const RtSegment = ( props: RtSegmentProps & HTMLAttributes & RtBaseProps ) => { const { id, className, active, size = 'md', counter, radius, disabled, unselectable, grow, activeUse, use, text, icon: Icon, onClick, ...restProps } = props; const baseProps = useRtBaseProps(restProps, '0.2.2'); return (
{Icon && (
)} {text && ( {text} )} {counter && ( {counter} )}
); };