2021-12-03 20:37:38 +01:00
|
|
|
import React from 'react';
|
|
|
|
import Tippy from '@tippyjs/react';
|
|
|
|
import StyledWrapper from './StyledWrapper';
|
|
|
|
|
|
|
|
const Dropdown = ({icon, children, onCreate, placement}) => {
|
|
|
|
return (
|
|
|
|
<StyledWrapper className="dropdown">
|
2022-03-13 15:59:47 +01:00
|
|
|
<Tippy
|
2021-12-03 20:37:38 +01:00
|
|
|
content={children}
|
|
|
|
placement={placement || "bottom-end"}
|
|
|
|
animation={false}
|
|
|
|
arrow={false}
|
|
|
|
onCreate={onCreate}
|
|
|
|
interactive={true}
|
|
|
|
trigger="click"
|
|
|
|
appendTo="parent"
|
|
|
|
>
|
|
|
|
{icon}
|
|
|
|
</Tippy>
|
|
|
|
</StyledWrapper>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Dropdown;
|