import React, { ReactNode } from 'react' import Avatar from '../avatar' import useTheme from '../use-theme' import useScale, { withScale } from '../use-scale' import useClasses from '../use-classes' interface Props { name: ReactNode | string src?: string text?: string className?: string altText?: string } const defaultProps = { className: '' } type NativeAttrs = Omit, keyof Props> export type UserProps = Props & NativeAttrs const UserComponent: React.FC> = ({ src, text, name, children, className, altText, ...props }: React.PropsWithChildren & typeof defaultProps) => { const theme = useTheme() const { SCALES, getScaleProps } = useScale() const scale = getScaleProps('scale') as number | undefined return (
{name} {children}
) } UserComponent.defaultProps = defaultProps UserComponent.displayName = 'HuiUser' const User = withScale(UserComponent) export default User