import { Button as ButtonRAC } from 'react-aria-components' import { Loading } from '../Loading/Loading' import { MaterialIcon } from '../Icons/MaterialIcon' import { Typography } from '../Typography' import type { ButtonProps } from './types' import { variants } from './variants' export function Button({ variant, color, size, wrapping, fullWidth, leadingIconName, trailingIconName, className, children, ...props }: ButtonProps) { const classNames = variants({ variant, color, size, wrapping, fullWidth, className, }) return ( {({ isPending }) => { return ( <> {leadingIconName && !isPending ? ( ) : null} {children} {trailingIconName && !isPending ? ( ) : null} {isPending ? ( ) : null} ) }} ) }