Fix Codemirror performance!!

This commit is contained in:
Gregory Schier
2023-03-09 10:50:55 -08:00
parent 4d806ff2b1
commit e4f6c919dc
19 changed files with 848 additions and 211 deletions

View File

@@ -8,11 +8,22 @@ import { Icon } from './Icon';
type Props = IconProps & ButtonProps & { iconClassName?: string; iconSize?: IconProps['size'] };
export const IconButton = forwardRef<HTMLButtonElement, Props>(function IconButton(
{ icon, spin, className, iconClassName, size, iconSize, ...props }: Props,
{ icon, spin, className, iconClassName, size = 'md', iconSize, ...props }: Props,
ref,
) {
return (
<Button ref={ref} className={classnames(className, 'group')} size={size} {...props}>
<Button
ref={ref}
className={classnames(
className,
'group',
'!px-0',
size === 'md' && 'w-9',
size === 'sm' && 'w-9',
)}
size={size}
{...props}
>
<Icon
size={iconSize}
icon={icon}