mirror of
https://github.com/remvze/moodist.git
synced 2025-12-19 09:54:17 +00:00
33 lines
654 B
TypeScript
33 lines
654 B
TypeScript
import { Tooltip } from '@/components/tooltip';
|
|
|
|
import { cn } from '@/helpers/styles';
|
|
|
|
import styles from './button.module.css';
|
|
|
|
interface ButtonProps {
|
|
disabled?: boolean;
|
|
icon: React.ReactElement;
|
|
onClick: () => void;
|
|
smallIcon?: boolean;
|
|
tooltip: string;
|
|
}
|
|
|
|
export function Button({
|
|
disabled = false,
|
|
icon,
|
|
onClick,
|
|
smallIcon,
|
|
tooltip,
|
|
}: ButtonProps) {
|
|
return (
|
|
<Tooltip content={tooltip} placement="bottom" showDelay={0}>
|
|
<button
|
|
className={cn(styles.button, smallIcon && styles.smallIcon)}
|
|
disabled={disabled}
|
|
onClick={onClick}
|
|
>
|
|
{icon}
|
|
</button>
|
|
</Tooltip>
|
|
);
|
|
}
|