1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-05-03 00:26:41 +07:00

added hoverable hints

This commit is contained in:
Fedor Katurov 2022-12-14 16:18:36 +06:00
parent c888f13c60
commit f5ca735049
7 changed files with 278 additions and 29 deletions

View file

@ -0,0 +1,30 @@
import React, { FC, ReactNode } from 'react';
import classNames from 'classnames';
import { DivProps } from '~/utils/types';
import styles from './styles.module.scss';
interface HoverableProps extends DivProps {
icon?: ReactNode;
}
const Hoverable: FC<HoverableProps> = ({
children,
className,
icon,
...rest
}) => (
<div
{...rest}
className={classNames(styles.hoverable, className, {
[styles.with_icon]: !!icon,
})}
>
{icon && <div className={styles.icon}>{icon}</div>}
{children}
</div>
);
export { Hoverable };