import { __rest } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import { useContext } from 'react';
import clsx from 'clsx';
import ConfigProviderContext from '../config-provider/ConfigProviderContext';

const TypographyBase = _a => {
  var {
    type,
    size = 'md',
    level = 4,
    center,
    ellipsis,
    className,
    children,
    strong,
    underline,
    disabled,
    renderType,
    delete: del
  } = _a,
      props = __rest(_a, ["type", "size", "level", "center", "ellipsis", "className", "children", "strong", "underline", "disabled", "renderType", "delete"]);

  const {
    prefixCls,
    createNamespace
  } = useContext(ConfigProviderContext);
  const [bem] = createNamespace('typography', prefixCls);
  const elli = ellipsis === true ? 1 : ellipsis;
  return _jsx("div", Object.assign({
    className: clsx(className, bem([type, size, renderType, {
      center,
      strong,
      underline,
      disabled,
      delete: del,
      [`l${level}`]: renderType === 'title' && level
    }]), {
      'rv-ellipsis': elli === 1,
      [`rv-multi-ellipsis--l${elli}`]: elli && elli > 1
    })
  }, props, {
    children: children
  }));
};

export default TypographyBase;