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