import React, { FC } from "react"; import { InfixKind } from "./SliderConstants"; import { useSliderInfixComponent } from "./SliderInfixHooks"; import cx from "classnames"; import { getStyle } from "../../helpers/typesciptCssModulesHelper"; import { withStaticProps, VibeComponentProps } from "../../types"; import styles from "./SliderInfix.module.scss"; export interface SliderInfixProps extends VibeComponentProps { /** * kind (type/mode) of Infix prefix/postfix * Infix - additional inserted by Consumer - component/string/number etc. */ kind?: InfixKind; } const SliderInfix: FC & { kinds?: typeof InfixKind } = ({ kind = SliderInfix.kinds.PREFIX }) => { const [isShow, modificators, InfixComponent, inlineStyle] = useSliderInfixComponent(kind); return ( isShow && (
getStyle(styles, m)) )} style={inlineStyle} > {InfixComponent}
) ); }; export default withStaticProps(SliderInfix, { kinds: InfixKind });