mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-16 22:16:49 +01:00
17 lines
487 B
TypeScript
17 lines
487 B
TypeScript
import { forwardRef } from 'react';
|
|
import { Icon, IconProps } from './Icon';
|
|
import { Button, ButtonProps } from './Button';
|
|
|
|
type Props = Omit<IconProps, 'size'> & ButtonProps;
|
|
|
|
export const IconButton = forwardRef<HTMLButtonElement, Props>(function IconButton(
|
|
{ icon, spin, ...props }: Props,
|
|
ref,
|
|
) {
|
|
return (
|
|
<Button ref={ref} className="group" {...props}>
|
|
<Icon icon={icon} spin={spin} className="text-gray-700 group-hover:text-gray-900" />
|
|
</Button>
|
|
);
|
|
});
|