2024-03-06 06:31:25 -05:00
|
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
import { IconTextButtonProps } from '../types/icon-text-button-props'
|
|
|
|
import Button from './button'
|
|
|
|
|
|
|
|
export default function IconTextButton({
|
|
|
|
children,
|
|
|
|
className,
|
|
|
|
leadingIcon,
|
|
|
|
size = 'default',
|
|
|
|
trailingIcon,
|
|
|
|
...props
|
|
|
|
}: IconTextButtonProps) {
|
2024-03-27 06:53:54 -04:00
|
|
|
const materialIconClassName = size === 'large' ? 'icon-large' : 'icon-small'
|
2024-03-06 06:31:25 -05:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Button size={size} {...props}>
|
|
|
|
{leadingIcon && (
|
|
|
|
<MaterialIcon type={leadingIcon} className={materialIconClassName} />
|
|
|
|
)}
|
|
|
|
{children}
|
|
|
|
{trailingIcon && (
|
|
|
|
<MaterialIcon type={trailingIcon} className={materialIconClassName} />
|
|
|
|
)}
|
|
|
|
</Button>
|
|
|
|
)
|
|
|
|
}
|