import React, { ReactNode } from 'react' import Avatar from '../avatar' import useTheme from '../use-theme' import useScaleable, { withScaleable } from '../use-scaleable' 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, getScaleableProps } = useScaleable() const scale = getScaleableProps('scale') as number | undefined return (
{name} {children}
) } UserComponent.defaultProps = defaultProps UserComponent.displayName = 'GeistUser' const User = withScaleable(UserComponent) export default User