import type { HTMLAttributes } from 'vue';
import { defineComponent } from 'vue';
import useConfigInject from '../_util/hooks/useConfigInject';
import classNames from '../_util/classNames';
import type { Direction } from '../config-provider';
export interface TypographyProps extends HTMLAttributes {
direction?: Direction;
prefixCls?: string;
}
export interface InternalTypographyProps extends TypographyProps {
component?: string;
}
const Typography = defineComponent({
name: 'ATypography',
inheritAttrs: false,
setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('typography', props);
return () => {
const {
prefixCls: _prefixCls,
class: _className,
direction: _direction,
component: Component = 'article' as any,
...restProps
} = { ...props, ...attrs };
return (
{slots.default?.()}
);
};
},
});
Typography.props = {
prefixCls: String,
component: String,
};
export default Typography;